i have a shell script which call by php and pass a variable ($1)
When i using MYVAR = $1
, and echo MYVAR
is not working
how can i assign this variable ($1
) to another variable and split it with delimiter "," and convert it into a array for looping?
Answer
Well, guessed answer in absence of code.
Variable assignments in shell scripts must be:
MYVAR=$1
Spaces around are incorrect:
MYVAR = $1
And the echo must output an actual variable, using the $
prefix:
echo $MYVAR
Not just the literal string:
echo NOVAR
No comments:
Post a Comment