delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/01/07/13:11:50

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; q=dns; s=
default; b=jKkVjyRx6s4ZJiYUDpzj+uCEsKUh/h0r7GGQH6RDbbIwJw+sqENWp
9/uYVNCEq4NZomQwqEMJlJjtWI9Y2pGLpr/7Auf3kQc8zf48P3CWEDZqokzCRZ3N
C3XQeNqDrdynvZVPqxWe3CSyQxvmnQGGtrCvoaBQRO3zknljfLMdVg=
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; s=default;
bh=KeAlyWDlaA9ObZrSNDCVVf5uAMU=; b=R7VTqSgI+EXU6N8fQcAOnkQ/g/jG
J+fuQmEeP7rY79sJhlei1luoKi1pl6+7eV9dWquUmGkseYOi5r3Xs02vp2H3e8WJ
bnZzs2HrSbENFasAa+vt2H9pdAy6MkRluwN8A3iuD5WLa5g1IlF1C6rmUPKlRZDR
uDHZ+T3+wh6AfYU=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: plane.gmane.org
To: cygwin AT cygwin DOT com
From: Paul <Paul DOT Domaskis AT gmail DOT com>
Subject: Re: Force
Date: Wed, 7 Jan 2015 00:06:54 +0000 (UTC)
Lines: 37
Message-ID: <loom.20150107T010020-206@post.gmane.org>
References: <loom DOT 20150106T203355-631 AT post DOT gmane DOT org> <54AC48DE DOT 6000806 AT cygwin DOT com> <loom DOT 20150106T221646-526 AT post DOT gmane DOT org> <loom DOT 20150106T222234-870 AT post DOT gmane DOT org> <54AC55DE DOT 4090801 AT redhat DOT com>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes

Eric Blake <eblake <at> redhat.com> writes:
|On 01/06/2015 02:28 PM, Paul wrote:
|>Paul <Paul.Domaskis <at> gmail.com> writes:
|>> Both solutions are great.  I'll set the --append-exe in my bash
|>> aliases, and for systems outside of my normal working environment
|>> (e.g., working with someone on their unix sessions), I know I can
|>> force display of .exe using asterisk.
|> 
|> Drat. If I pipe files to 'xargs ls', the unaliased ls command is
|> used:
|> 
|>    type -pa pdfcrop | xargs ls
| 
| alias xargs='xargs '
| 
| Then the alias expansion of xargs will in turn allow alias expansion
| of the next argument.  (Except that you then have to also create
| trailing-space aliases for all options you commonly pass to xargs
| between 'xargs' and the final command name).

I'm not sure what you mean by needing trailing space aliases for
common xargs options, but I'm going to take that as a warning of
dragons lurking in that direction and avoid it.

| Sadly, xargs is one of the cases where shell functions won't help
| (xargs doesn't execute the shell function).  Your other solution is
| to modify $PATH to point to a directory under your control as the
| first thing, where 'cat /your/ls' contains:
|
|     #!/bin/sh
|     exec /bin/ls --append-exe "$ <at> "
| 
| such that your script then gets picked up by xargs, and you no
| longer have to worry about aliases.

OK, I'll keep that one in mind -- wrapper scripts rather than aliases
and functions.  Thanks.


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