delorie.com/archives/browse.cgi | search |
X-Spam-Check-By: | sourceware.org |
Date: | Thu, 27 Apr 2006 19:30:44 -0400 |
From: | Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com> |
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 |
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 |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |