Andrew DeFaria sent the following at Thursday, November 25, 2010 10:15 AM
> 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
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
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
Am 25.11.2010 14:29, schrieb Alexandre Bezroutchko:
Hi Fergus,
The problem is $HOME contains '/' character used as delimited in
regex. You need to escape it first:
HOME_ESCAPED=`echo "$HOME" | sed 's#/#/#g'`
echo 123 | sed "s/2/$HOME_ESCAPED/g"
It is not cygwin-specific.
Cheers,
Alex
ww
Hi Fergus,
The problem is $HOME contains '/' character used as delimited in regex.
You need to escape it first:
HOME_ESCAPED=`echo "$HOME" | sed 's#/#/#g'`
echo 123 | sed "s/2/$HOME_ESCAPED/g"
It is not cygwin-specific.
Cheers,
Alex
www.gremwell.com
On 11/25/2010 02:15 PM, Fergus wrote:
I can't get the syntax quite right.
Can anybody help, please? Thank you very much.
Thanks very much indeed for various suggestions, much appreciated. I
guess by yakking on about "drivename" I moved the focus of my question
to its practical application and thereby managed to blur things. My real
On 11/24/10, Fergus wrote:
> 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:\
I'm not the expert on cygwin.exe, but there might be an easier way to
solve you problem.
For POSIX shell scripts you could keep a symlink /my-usb-stick pointing
to /cygdrive/X, and use that symlink in your scripts. Similarly, for
Windows batch scripts you keep drive mapping with native Windows
8 matches
Mail list logo