IFS=:
-try_path=true
+try_without_dir=true
# First we try "bc", then "$dir/bc" for each item in $PATH.
for dir in dummy:$PATH; do
- if [ "$try_path" = true ]; then
+ if [ "$try_without_dir" = true ]; then
# first iteration
bc=bc
- try_path=false
+ try_without_dir=false
else
# second and later iterations
bc="$dir/bc"
done
echo "No working bc found. Consider installing GNU bc." >&2
-echo "cat >/dev/null"
+if [ "$1" = ignore ]; then
+ echo "cat >/dev/null"
+ exit 0
+fi
exit 1