This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Variable read error? Multiple spaces
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 27 Apr 2006 19:30:44 -0400
- Subject: Re: Variable read error? Multiple spaces
- References: <20060427230838.70271.qmail@web38913.mail.mud.yahoo.com>
- Reply-to: cygwin at cygwin dot com
On Thu, Apr 27, 2006 at 04:08:38PM -0700, Siddhartha Shivshankar wrote:
>Hi. After I try to read the contents of a file containing
>multiple spaces into a bash variable, only one space is seen
>
>in the variable. Output similar to the following 2 space
>example is seen for 3 spaces as well. Is this an error? If
>so, does anyone know a work-around?
>
>Thanks,
>-Siddhartha.
>
>---------- Output from bash follows -----------
>$ cat>i.txt
>Hello world
>
>$ export b=`cat i.txt`
>
>$ echo $b
>Hello world
Try using quotes, i.e., echo "$b" .
cgf
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/