I want to print in the Terminal something like this:
lollipop
lollipo
lollip
lolli
loll
lol
lo
l
However if i do -n twice i get a newline and then it just prints "-n" if i use echo. How can i avoid this from happening and make this mess not print when i run X:
lollipop
lollipo-nlollip-nlolli-nloll-nlol-nlo-nl
X:
echo lollipop -n lollipo -n lollip -n lolli -n loll -n lol -n lo -n l
printf "lollipop\nlollipo\nlollip\nlolli\nloll\nlol\nlo\nl"
echo
and not something better?-n
removes the trailing newline, it doesn't add it. And the main problem is even if it added it, you pass a single string toecho
.