X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0	tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Andrew DeFaria <Andrew@DeFaria.com>
Subject: Re: Portable Cygwin: replacing drivename in a text file
Date: Thu, 25 Nov 2010 10:14:50 -0500
Lines: 13
Message-ID: <icluha$338$1@dough.gmane.org>
References: <4CEE6175.2030805@bonhard.uklinux.net> <4CEE64C5.2080007@gremwell.com> <4CEE6FAF.5080405@arcor.de> <4CEE742C.2060305@gremwell.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9pre) Gecko/20100821 Lightning/1.0b2 Lanikai/3.1.3pre
In-Reply-To: <4CEE742C.2060305@gremwell.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

  On 11/25/2010 09:35 AM, Alexandre Bezroutchko wrote:
>> you can use a different separator in the sed command.
>> You can use the following line
>>
>>   echo 123 | sed "s%2%${HOME}%g"
>
> Right, this will work in most cases. But will fail if $HOME happens to 
> contains % sign.
> The version I have suggested in the previous post is more robust.
How often does that happen?
-- 
Andrew DeFaria <http://defaria.com>
Can fat people go skinny-dipping?


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

