www.delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=-0.3 required=5.0 tests=AWL,BAYES_40,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,TW_YG |
X-Spam-Check-By: | sourceware.org |
Message-ID: | <377741.48966.qm@web25505.mail.ukl.yahoo.com> |
Date: | Wed, 24 Nov 2010 13:24:46 +0000 (GMT) |
From: | Marco Atzeri <marco_atzeri AT yahoo DOT it> |
Subject: | R: Portable Cygwin: replacing drivename in a text file |
To: | Cygwin ML <cygwin AT cygwin DOT com>, Fergus <fergus AT bonhard DOT uklinux DOT net> |
Cc: | Fergus <fergus AT bonhard DOT uklinux DOT net> |
In-Reply-To: | <4CED0E0D.4080106@bonhard.uklinux.net> |
MIME-Version: | 1.0 |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
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 |
--- Mer 24/11/10, Fergus ha scritto: > Running Cygwin off a portable USB > stick. >=20 > Different host machines typically allocate a different > drivename to the stick. >=20 > Previous use, say it was J:. A not-quite-portable > application needed a settings.ini file built with many > occurrences of the string j:\usr\local\bin. The file was > built and saved. >=20 > Current use: now it's K:. >=20 > I could re-configure settings.ini with > sed -i 's/j:/k:/g' settings.ini > but in general I don't know (and don't want to bother with) > what the drivename labels were, or are. Something like > sed -i 's/.:\\/ replacementstring /g' settings.ini > will in fact be sufficiently strong to make the change > olddriveletter: to newdriveletter: where, and only where, I > need it, but experiment as I might with > replacementstring =3D cygpath -w > replacementstring =3D `cygpath -w` > and other variations, I can't get the syntax quite right. >=20 > Can anybody help, please? Thank you very much. >=20 > Fergus something like this ? a=3D$(cygpath -w /) $ echo $a E:\cygwin2 -- 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |