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
The promt response with a > sign and I don't get the echo.
If I paste the same code into the command line, with enters, it returns the result as expected:
Code:
a="1" ;
if [ "$a" = "1" ]; then
echo $a
fi
How could this be done in command line, using one line command?
Thanks.