X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake Subject: Re: Variable read error? Multiple spaces Date: Thu, 27 Apr 2006 23:31:56 +0000 (UTC) Lines: 32 Message-ID: References: <20060427230838 DOT 70271 DOT qmail AT web38913 DOT mail DOT mud DOT yahoo DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Siddhartha Shivshankar yahoo.com> writes: > > 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? It is an error on your part for not quoting properly. But this is not cygwin-specific, so I would advise getting a good tutorial on shell programming and reading it (the web has plenty of resources, google is your friend). > $ export b=`cat i.txt` > > $ echo $b > Hello world Try echo "$b" instead. > > $ export b=$(