replace `which' in fbsetbg and fbgm with `command -v'
markt markt
3 files changed,
14 insertions(+),
60 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,6 +1,8 @@
(Format: Year/Month/Day) Changes for 1.0rc3: *07/01/02: + * Replace `which' in fbsetbg and fbgm with `command -v' (Mark) + util/fbsetbg fluxbox-generate_menu.in * Don't escape regular expression metacharacters in apps file, bug #1595497 (Mark) Remember.cc ClientPattern.cc
M
util/fbsetbg
→
util/fbsetbg
@@ -131,28 +131,9 @@
EOF } -# some which's have a reliable return code, some don't -# Lets figure out which which we have. -if which this_program_does_not_exist-no_really-aA1zZ9 >/dev/null 2>/dev/null; then - # can't rely on return value - find_it() { - file=`which $1 2> /dev/null` - if [ -x "$file" ]; then - if [ $# -gt 1 ]; then - shift - $* - fi - return 0 - else - return 1 - fi - } -else - # can rely on return value - find_it() { - which $1 > /dev/null 2>&1 && shift && $* - } -fi +find_it() { + command -v $1 > /dev/null 2>&1 && shift && $* +} message() {@@ -349,7 +330,7 @@ if find_it $wpsetter; then
if [ ! "$wpsetter" = Esetroot ]; then WPSETTER=$wpsetter break - elif ldd `which Esetroot`|grep libImlib 2>&1 > /dev/null; then + elif ldd `command -v Esetroot`|grep libImlib 2>&1 > /dev/null; then WPSETTER=$wpsetter break else