IF condition in shell command line
I have some trouble entering if-then condition in a single line on a command prompt.
I am trying this one: Code:
a="1" ; if [ "$a" = "1" ]; then echo $a fi If I paste the same code into the command line, with enters, it returns the result as expected: Code:
a="1" ; Thanks. |
a="1" ; if [ "$a" = "1" ]; then (hit Enter) echo $a (hitEnter) fi
it does need a character return i guess. |
You missed a semi-colon
Code:
a="1"; if [ "$a" = "1" ]; then echo $a; fi |
Quote:
It works now. Thank you. |
All times are GMT -5. The time now is 09:23 PM. |