X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.2 required=5.0	tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,KHOP_RCVD_UNTRUST,KHOP_THREADED,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL,TW_YG
X-Spam-Check-By: sourceware.org
Message-ID: <20130223185105.3960@binki>
Date: Sat, 23 Feb 2013 18:51:05 +1000
From: wynfield@gmail.com
To: <cygwin@cygwin.com>
Subject: Re: $USER is not resolved in paths sometimes
In-reply-to: Your message of Sat, 23 Feb 2013 09:24:32 +1000	 <20130223092432.2564@binki>
References: <kg8pct$bnq$1@ger.gmane.org> <20130223092432.2564@binki>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com


Sorry, I copied all examples with the -w option which is wrong for converting into a unix like pathname. 

To convert to a unix pathname use the option  -u
       to convert to a windows pathname use   -w

Run:   cygpath --help 


for more detals.  and to get the output in the sell use $(...) or the ticks `....`
with the command and all arguments inside.


> 
> I agree with Achim.  Don't use Microsoft Windows paths.
> Cygwin has a function called cygpath which is very handy to use to convert paths and use in zsh and other shell scripts
> 
> In zsh, using zsh syntax, I use it like this:
> 
> Convert the first argument to a micrsoft window format pathname
>    winpath=$(cygpath -w $1)
> 
> or to convert a Windows formatted pathname to unix like do:
>     fname=$(cygpath -w ${windows-type-ifname})
> 		 
> a hardcoded filename would be
>     fname=$(cygpath -w ${C:\miscrosoft\windows-type-ifname.abc})
> 
> * you may need to quote the flename to escape : or \....
> 

--
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

