[hackers] [dmenu] using the old-style fashion we uses earlier

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Fri Feb 23 15:30:27 2007

changeset: 176:356e2ff751bc
tag: tip
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Fri Feb 23 15:28:25 2007 +0100
summary: using the old-style fashion we uses earlier

diff -r 27843b6669d6 -r 356e2ff751bc dmenu_path
--- a/dmenu_path Fri Feb 23 14:39:54 2007 +0100
+++ b/dmenu_path Fri Feb 23 15:28:25 2007 +0100
@@ -1,2 +1,9 @@
 #!/bin/sh
-/bin/ls -lL `echo $PATH | tr : ' '` 2> /dev/null | awk '$1 ~ /^[^d].*x/ { print $NF }' | sort -u
+IFS=:
+for dir in $PATH
+do
+ for file in "$dir"/*
+ do
+ test -x "$file" && echo "${file##*/}"
+ done
+done | sort -u
Received on Fri Feb 23 2007 - 15:30:27 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:49 UTC