Once more a very beginners question: what is wrong in my second 'if' statement?
PHP Code:
# my shell arguments
NB_ARGS=$#
ARGS=$@
echo arguments\: $ARGS; echo
# inspect arguments
if [[ $# -lt 3 && $# -ge 1 ]]; then
echo now_in_first_if # here's line 23
if [[ "$1" -eq "deploy" ]]; then # this gives the error
echo blaaaaaaaat
fi
fi
When I launch the script:
PHP Code:
st25219@mx73:ian$ deliver.ksh deploy
it gives an error message:
PHP Code:
arguments: deploy
now_in_first_if
deliver.ksh[23]: deploy: bad number
If I change the 'if' statement in a simple
then things work fine.
I do compare the string "deploy" in a correct way, don't I?
ps: When I use single square brackets '[ ]' instead of double square brackets '', it still raises the error, but now it continues the rest of the script (some simple 'echo's, which I haven't shown here).