diff options
author | Joas Schilling <coding@schilljs.com> | 2019-04-08 17:59:25 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-04-08 18:00:54 +0300 |
commit | e267c6be4fe7bf116e64d50a0e08d8dee839d3bd (patch) | |
tree | ac580ef6eb9a50983cbad4bcb85d49e7f813244e /sample-commands | |
parent | 074d5e306296d63c9163401cbd385b498b23fa8c (diff) |
More verbose feedback on sample commands
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'sample-commands')
-rw-r--r--[-rwxr-xr-x] | sample-commands/calc.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sample-commands/calc.sh b/sample-commands/calc.sh index 7ec3c6301..73c514867 100755..100644 --- a/sample-commands/calc.sh +++ b/sample-commands/calc.sh @@ -1,4 +1,11 @@ #!/usr/bin/env bash + +CALCULATOR=$(which "bc") +if ! [ -x "$CALCULATOR" ]; then + echo "Basic calculator package (bc - https://www.gnu.org/software/bc/) not found" + exit 1 +fi + while test $# -gt 0; do case "$1" in --help) @@ -16,13 +23,6 @@ while test $# -gt 0; do esac done -CALCULATOR=$(which "bc") -if ! [ -x "$CALCULATOR" ]; then - echo "Basic calculator package (bc) not found" - exit 1 -fi - - set -f echo "$@ =" echo $(echo "$@" | bc) |