This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Variable read error? Multiple spaces
- From: Siddhartha Shivshankar <s_siddhartha at yahoo dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 27 Apr 2006 16:08:38 -0700 (PDT)
- Subject: Variable read error? Multiple spaces
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
$ export b=`<i.txt`
$ echo $b
Hello world
$ export b=$(cat i.txt)
$ echo $b
Hello world
$ export b=$(<i.txt)
$ echo $b
Hello world
$ cat i.txt
Hello world
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
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/