AWS SSM Linux Shell Script Closing Paren Expected Error
Monday, September 1, 2025
This is a repost from my old blog. First posted in 3/21/2019.
I ran my scripts through AWS SSM and received the "closing paren expected" error message. Quick check on my code, I was missing items in two different situations:
- I was missing closing parentheses
\), so adding it solves the issue. My code was like:
if [ \( <expr> ]; then <do this>; fi
- My closing parentheses was not prefixed by space, so adding a space fixed it. It was like:
if [ \( <expr>\) ]; then <do this>; fi