[ale] expanding $(echo -e "$word\t$word")

Joe Steele joe at madewell.com
Sat Jan 26 18:58:04 EST 2002


All four of the examples you cite do, in fact, work.  A few of the 
countless other ways it can be done are:

line=$(echo -e $word'\t'$word)
line=`echo -e $word'\t'$word`
line=$(echo -e $word\\t$word)
line=`echo -e $word\\\\t$word`


Your problem is that you are incorrectly examining the result using:

echo $line

when you should instead use:

echo "$line"

--Joe

-----Original Message-----
From:	David S. Jackson [SMTP:deepbsd at earthlink.net]
Sent:	Saturday, January 26, 2002 2:33 AM
To:	ale at ale.org; kplug-list at kernel-panic.org
Subject:	[ale] expanding $(echo -e "$word\t$word")

When I go line=`echo -e $word"\t"$word`; echo $line I only get a
single space for the \t.  I've tried the following to no avail:

line=$(echo -e $word"\t"$word)
line=`echo -e "$word\t$word"`
line=`echo -e $word"\t"$word`

and they all expand to only one space.  I want the \t to expand
to a full tab space.  What am I doing wrong?  (Using bash 2.x).


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list