This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: semicolon colon separated env vars to unix and viceversa
- To: Enrico Spinielli <Enrico dot Spinielli at marconi dot com>
- Subject: Re: semicolon colon separated env vars to unix and viceversa
- From: Pavel Tsekov <ptsekov at syntrex dot com>
- Date: Thu, 08 Nov 2001 18:54:42 +0100
- CC: cygwin at cygwin dot com
- References: <OF77D5934B.B98E7E47-ONC1256AFE.005D98E0@uk.marconicomms.com>
Ciao, Enrico
You can try the "cygpath" utility to perform this task.
Enrico Spinielli wrote:
>
> Hi,
> I wanted to transform my CLASSPATH env var settings (yes, I
> am using Java :-) from Windows format (semicoln-separated
> list of win paths) to Unix format (colon separated list of
> unix paths) and here is an excerpt of the script I have written:
> #!/bin/bash
> # change an env var from Windows format (semicolon separated)
> # to Unix format (colon separated)
> IFS=@
> for i in ${1//;/@}
> do
> a=${a}:$(cygpath -u $i)
> done
> echo $a
>
> This works fine but I am wondering if there is something else
> given that PATH is automatically converted by cygwin...
>
> Any idea?
> bye
> Enrico
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/