setup: tolerate `which` failures
If this script is sourced in a shell that has something like
`set -e`, then it fails if the column program does not exist
because the `which columm` fails. Make a few changes to
tolerate this and not fail:
- Use $(...) rather than `...`.
- Use `... || true` when appropriate to allow continuance.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I9008778e8aee4747faa4decff74a2fb361a206ed
diff --git a/setup b/setup
index 57b3ded..db9ede6 100755
--- a/setup
+++ b/setup
@@ -21,10 +21,10 @@
fi
# Check if 'column' command is present
-COLUMN=`which column`
+COLUMN=$(which column || true)
if [ -z "$COLUMN" ]; then
# If it is not, use 'cat'
- COLUMN=`which cat`
+ COLUMN=$(which cat)
fi
machine() {