-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC1036
Vidar Holen edited this page May 22, 2018
·
5 revisions
echo (foo) bar
Depends on your intention:
echo "(foo) bar" # Literal parentheses
echo "$(foo) bar" # Command expansion
echo "foo bar" # Tried to use parentheses for grouping or function invocation
ShellCheck expected an ordinary shell word but found an opening parenthesis instead.
Determine what you intended the parenthesis to do and rewrite accordingly. Common issues include:
- Wanting them to be literal, as in
echo (FAIL) Some tests failed
. In this case, it requires quoting. - Wanting command expansion, as in
echo Today is (date)
. Add the missing$
:echo "Today is $(date)"
- Adding parentheses because other languages need them in that context, such as
foo (bar, 42)
to call a function. This should befoo bar 42
. Also, shells do not support tuples or passing arrays as single parameters.
None
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!