[
- this is a test command, so you need a space between [
and "$1"
, as well as a space between "1"
and closing ]
Edit
Just for clarification, space is necessary because [
is a different syntax of the test
bash command, so the following script method is written:
#!/bin/bash if test "$1" == "1" then echo $1 else echo "no" fi
What else can be simplified to
#!/bin/bash [ "$1" == "1" ] && echo "$1" || echo "no"
source share