[wellylug] curly csv formatting
jumbophut
jumbophut at gmail.com
Tue Jul 13 00:19:44 NZST 2004
On Mon, 12 Jul 2004 23:53:13 +1200, Mark Signal wrote:
> If you know sed can you figure out how to use it to convert windows paths to
> cygwin paths?
>
<snip>
> eg %USERPATH% under xp = c:\Documents and Settings\mark
> rsync under cygwin wants to see this : "/cygdrive/c/Documents and
> Settings/mark"
>
You could try:
echo 'c:\Documents and Settings\mark\other\guff' | sed -e
's$\([a-zA-Z]\):\\\(.*\)$/cygdrive/\1/\2$' -e 's$\\$/$g'
or, if %USERPATH% is some kind of freaky environment variable that
cygwin knows about:
echo "%USERPATH%\other\guff" | sed -e
's$\([a-zA-Z]\):\\\(.*\)$/cygdrive/\1/\2$' -e 's$\\$/$g'
It works for me anyway, with one important restriction: you must not
have any '/' characters in the path (the entire path, not just the
%USERPATH% bit). Since this seems to be an illegal character in
Windows filenames (<http://www.macwindows.com/tutfiles.html>) I don't
expect it will be a problem, but you never know.
Cheers
Tony
More information about the wellylug
mailing list