I have the following code snippet:
#!/bin/sh
if [ $1 = hi ]; then
echo 'The first argument was "hi"'
else
echo -n 'The first argument was not "hi" -- '
echo It was '"'$1'"'
fi
And I don't know what the flag -n after echo in the else statement stands for, does anyone knows the answer?
Thank you very much!
echomight be a built-in (e.g. in Bash, Zsh). So while there may be aman-page for/bin/echoor so,help echowould be the way to go in that case (i.e. Bash only). Andtype echocan be used to find out which one your shell uses (built-in or command etc ..., i.e. in both Bash and Zsh again). – 0xC0000022L Apr 12 '20 at 21:16echo hiand (2)echo -n hi. Doesecho -nbehave differently? – Andy Dalton Apr 12 '20 at 23:08