delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/06/22/23:54:06

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:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
q=dns; s=default; b=GRM6KWcOVzJq+Kgzs47GqbfICs0xbisHKlQXaOb+IB1
0XYUgMwT9rPZii3cwu1lNcUe0alTw+40l56n3i+jqBllAkYlrxQvaRtkJEuPo6Gh
RwHM0t0IPP70oXtyLnd1dMQXT1HvozXEpmPosdsp457viWv4I4HNtjaWuL2Qb3ZQ
=
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:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
s=default; bh=0kxMY0Q5VSziPJ+3Tw8qfYwNhi4=; b=DTuD88GWjQa7KwIlJ
ZFXRa5/LdCpVuctPbYysMRoP/t09CbycQE5PF7/MhoWw63pctMiXtrd48c0Dbtph
eIMKXWdf6y8R6BOVdelIkdoTsN3K3+4xsVS6Em8OwqzHYrpuetQh+d3YLsJ8Cl4E
5Sq9n5TeH6GpPKQQgL6lBV1vDo=
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=-1.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,TW_YG autolearn=ham version=3.3.1
Message-ID: <51C67143.1000905@codespunk.com>
Date: Sat, 22 Jun 2013 23:53:39 -0400
From: "Matt D." <matt AT codespunk DOT com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Using cygpath with backticks
References: <51C5C520 DOT 7070801 AT codespunk DOT com> <kq4hi8$7v6$1 AT ger DOT gmane DOT org>
In-Reply-To: <kq4hi8$7v6$1@ger.gmane.org>

The test case I provided was a simplified version of what I intend to 
use it for.

Andrew is correct in that '$@' is not evaluated in the context of an 
alias and I would need to wrap up my intended alias in a function.

Thanks. I was having a brain fart there.


On 6/22/2013 11:58 AM, Andrew DeFaria wrote:
> 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:\
> $

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