delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/11/25/09:44:20

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE
X-Spam-Check-By: sourceware.org
Message-ID: <4CEE742C.2060305@gremwell.com>
Date: Thu, 25 Nov 2010 15:35:24 +0100
From: Alexandre Bezroutchko <abb AT gremwell DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Thunderbird/3.0.10
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Portable Cygwin: replacing drivename in a text file
References: <4CEE6175 DOT 2030805 AT bonhard DOT uklinux DOT net> <4CEE64C5 DOT 2080007 AT gremwell DOT com> <4CEE6FAF DOT 5080405 AT arcor DOT de>
In-Reply-To: <4CEE6FAF.5080405@arcor.de>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

> 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.

Best regards,
Alex
www.gremwell.com

>
> Regards
> Dirk
>
>
> -- 
> 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
>


--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019