diff options
Diffstat (limited to 'util/fbsetbg')
-rw-r--r-- | util/fbsetbg | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/util/fbsetbg b/util/fbsetbg index 17c2efe..0cf9cfb 100644 --- a/util/fbsetbg +++ b/util/fbsetbg | |||
@@ -133,9 +133,20 @@ Common tips to use with $command: | |||
133 | EOF | 133 | EOF |
134 | } | 134 | } |
135 | 135 | ||
136 | find_it() { | 136 | # some shell's hash returns 0 always |
137 | [ -n "$1" ] && hash $1 2> /dev/null | 137 | if hash this_program_does_not_exist-no_really-aA1zZ9 > /dev/null 2>&1; then |
138 | } | 138 | # can't rely on return value |
139 | # ash / ksh | ||
140 | find_it() { | ||
141 | which "$1" > /dev/null 2>&1 | ||
142 | } | ||
143 | else | ||
144 | # can rely on return value | ||
145 | # bash / dash / zsh / sh on Solaris | ||
146 | find_it() { | ||
147 | [ -n "$1" ] && hash "$1" 2> /dev/null | ||
148 | } | ||
149 | fi | ||
139 | 150 | ||
140 | message() { | 151 | message() { |
141 | 152 | ||