delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/06/22/11:58:38

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding
:in-reply-to; q=dns; s=default; b=Fu0sm0X3lmcxh5GSJHHX2/dHR6wh5E
qiUuv0szVEbaa+qRcqCGypl+FLJ6mCuh7NF+UJvLQpvDQF8lA5xgXjB6szCFpBFm
8UQ4RQPkIhEM5mP6vvd0l99IXgUdAo6JUIxSRI2nkKSvyd+P05YoSKaz3unhMoS8
ck3qw+qhxbOlU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding
:in-reply-to; s=default; bh=VA+8F+Hm1Av2QKE4i/Xv/8SRksI=; b=Fcg/
mpFJ5N4qSUtMX0PQFf+v7uiv3YbB6L28gpilKx4Ki2dKhFOqDC69nVa8a9GusrQa
MclzPFTJEX6pyM7CfEljCm/SLkjgNAbGDDRqlATqpXL+4iBPGx1CyS9fvHJt8AvL
1RNMRrTdlSkxjwMmD9rJg/8oqv0iVXxSgY/gf6Y=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,TW_YG autolearn=ham version=3.3.1
To: cygwin AT cygwin DOT com
From: Andrew DeFaria <Andrew AT DeFaria DOT com>
Subject: Re: Using cygpath with backticks
Date: Sat, 22 Jun 2013 08:58:05 -0700
Lines: 35
Message-ID: <kq4hi8$7v6$1@ger.gmane.org>
References: <51C5C520 DOT 7070801 AT codespunk DOT com>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6
In-Reply-To: <51C5C520.7070801@codespunk.com>

On 06/22/2013 08:39 AM, Matt D. wrote:
> Maybe I've just had a long week but I can't seem to get this to work:
>
> alias pathw='echo `cygpath -w "$@"`'
> pathw "/cygdrive/g/"
>
> I also tried:
>
> alias pathw='echo $(cygpath -w "$@")'
>
> cygpath just yells at me that I'm doing something wrong.
Try a real function:

$ function pathw {
 > echo $(cygpath -w "$@")
 > }
$ pathw /cygdrive/c
C:\
$

I don't think that $@ is evaluated in the context of an alias.

However, if all you are doing is echoing out the Windows path for a 
posix path then that's already what cygpath does. And the following also 
would work:

$ alias pathw='cygpath -w'
$ pathw /cygdrive/c
C:\
$
-- 
Andrew DeFaria <http://defaria.com>
Cranial-rectal inversion disorder - a condition where one's head is 
where one's butt should be and vice-versa, causing an otherwise sensible 
person to make an ass of himself.


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019