diff options
author | markt <markt> | 2007-01-02 05:43:25 (GMT) |
---|---|---|
committer | markt <markt> | 2007-01-02 05:43:25 (GMT) |
commit | 590b6c93d922a9940cb4c3d78d21509b289bd643 (patch) | |
tree | 04895360bf1c118505edeeaed4e7e446ebc0426c /util/fbsetbg | |
parent | 1cad4ca517ef9f4fb96b3c83970ed96767d6668e (diff) | |
download | fluxbox_paul-590b6c93d922a9940cb4c3d78d21509b289bd643.zip fluxbox_paul-590b6c93d922a9940cb4c3d78d21509b289bd643.tar.bz2 |
replace `which' in fbsetbg and fbgm with `command -v'
Diffstat (limited to 'util/fbsetbg')
-rw-r--r-- | util/fbsetbg | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/util/fbsetbg b/util/fbsetbg index 60118e5..917f89a 100644 --- a/util/fbsetbg +++ b/util/fbsetbg | |||
@@ -131,28 +131,9 @@ Common tips to use with $command: | |||
131 | EOF | 131 | EOF |
132 | } | 132 | } |
133 | 133 | ||
134 | # some which's have a reliable return code, some don't | 134 | find_it() { |
135 | # Lets figure out which which we have. | 135 | command -v $1 > /dev/null 2>&1 && shift && $* |
136 | if which this_program_does_not_exist-no_really-aA1zZ9 >/dev/null 2>/dev/null; then | 136 | } |
137 | # can't rely on return value | ||
138 | find_it() { | ||
139 | file=`which $1 2> /dev/null` | ||
140 | if [ -x "$file" ]; then | ||
141 | if [ $# -gt 1 ]; then | ||
142 | shift | ||
143 | $* | ||
144 | fi | ||
145 | return 0 | ||
146 | else | ||
147 | return 1 | ||
148 | fi | ||
149 | } | ||
150 | else | ||
151 | # can rely on return value | ||
152 | find_it() { | ||
153 | which $1 > /dev/null 2>&1 && shift && $* | ||
154 | } | ||
155 | fi | ||
156 | 137 | ||
157 | message() { | 138 | message() { |
158 | 139 | ||
@@ -349,7 +330,7 @@ if [ "$setterfromcommandline" != true ]; then | |||
349 | if [ ! "$wpsetter" = Esetroot ]; then | 330 | if [ ! "$wpsetter" = Esetroot ]; then |
350 | WPSETTER=$wpsetter | 331 | WPSETTER=$wpsetter |
351 | break | 332 | break |
352 | elif ldd `which Esetroot`|grep libImlib 2>&1 > /dev/null; then | 333 | elif ldd `command -v Esetroot`|grep libImlib 2>&1 > /dev/null; then |
353 | WPSETTER=$wpsetter | 334 | WPSETTER=$wpsetter |
354 | break | 335 | break |
355 | else | 336 | else |