X-Spam-Check-By: sourceware.org Date: Thu, 27 Apr 2006 19:30:44 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Variable read error? Multiple spaces Message-ID: <20060427233044.GA8870@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com 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-Disposition: inline In-Reply-To: <20060427230838.70271.qmail@web38913.mail.mud.yahoo.com> User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: 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 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/