X-Spam-Check-By: sourceware.org
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Subject: RE:  Re: stupid spaces in environment vars
Date: Thu, 8 Feb 2007 15:57:47 -0500
Message-ID: <31DDB7BE4BF41D4888D41709C476B657068AA9A9@NIHCESMLBX5.nih.gov>
In-Reply-To: A<88kms217e9imfeblbgurjc4e5c09b6ub2v@4ax.com>
References:  <45CA8AAF.9050107@cygwin.com> <533213.63517.qm@web58615.mail.re3.yahoo.com> A<88kms217e9imfeblbgurjc4e5c09b6ub2v@4ax.com>
From: "Buchbinder, Barry \(NIH/NIAID\) [E]" <BBuchbinder@niaid.nih.gov>
To: <cygwin@cygwin.com>
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
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l18Kw0qt016182

Andrew Schulman wrote on Thursday, February 08, 2007 11:36 AM:
>> BAD:
>> alias cdp=cd\ "$USERPROFILE"
>> +alias 'cdp=cd C:\Documents and Settings\me'
>> 
>> alias cdp="cd $USERPROFILE"
>> +alias 'cdp=cd C:\Documents and Settings\me'
>> 
>> GOOD:
>> alias cdp="cd \"$USERPROFILE\""
>> + alias 'cdp=cd "C:\Documents and Settings\me"'
>> 
>> alias cdp='cd "$USERPROFILE"'
>> + alias 'cdp=cd "$USERPROFILE"'
> 
> To avoid one layer of quoting, how about
> 
> function cdp () { cd "$USERPROFILE"; }

What about the following?

/c> cd "$(cygpath -u "${USERPROFILE}")"

Would it add anything to do this with cygpath, which already gives some
system paths?

/c> cygpath --help
 [snip]
System information:
  -A, --allusers        use `All Users' instead of current user for -D,
-P
  -D, --desktop         output `Desktop' directory and exit
  -H, --homeroot        output `Profiles' directory (home root) and exit
  -P, --smprograms      output Start Menu `Programs' directory and exit
  -S, --sysdir          output system directory and exit
  -W, --windir          output `Windows' directory and exit
Other options:
  -f, --file FILE       read FILE for input; use - to read from STDIN
[snip]
 [snip]

Might it be useful to add another option:

  -e, --environment VARIABLE       convert path in an environmental
variable

so that one could do

/c> cd "$(cygpath -u -e USERPROFILE)"

I know PTC, but I'm not a programmer.  As always much gratitude to
everyone who is a programmer and maintains or otherwise contributes to
cygwin!

- Barry
  -  Disclaimer: Statements made herein are not made on behalf of NIAID.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


