#1 01 Jan 2009 21:22

jrroberto15
Member
Registered: 01 Jan 2009
Posts: 1

spaces being truncated in outer echo command

Why is it when you perform an echo that has an output stream inside, the echo command removes the extra spaces? See example below.

echo "p      p"
p      p
echo $(echo "p      p")
p p

I need the echo command to output exactly what the inner command does. How do I fix it? Please suggest fix on the outermost echo command because I am not really going to use echo as the inner command.

Offline

#2 02 Jan 2009 20:58

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 1,025
Website

Re: spaces being truncated in outer echo command

echo "$(echo "p      p")"

Offline

Board footer

Powered by FluxBB