This is the mail archive of the
cygwin
mailing list for the Cygwin project.
R: Portable Cygwin: replacing drivename in a text file
- From: Marco Atzeri <marco_atzeri at yahoo dot it>
- 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>
- Date: Wed, 24 Nov 2010 13:24:46 +0000 (GMT)
- Subject: R: Portable Cygwin: replacing drivename in a text file
--- Mer 24/11/10, Fergus ha scritto:
> Running Cygwin off a portable USB
> stick.
>
> Different host machines typically allocate a different
> drivename to the stick.
>
> 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.
>
> Current use: now it's K:.
>
> 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 = cygpath -w
> replacementstring = `cygpath -w`
> and other variations, I can't get the syntax quite right.
>
> Can anybody help, please? Thank you very much.
>
> Fergus
something like this ?
a=$(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