This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Force
- From: Paul <Paul dot Domaskis at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 7 Jan 2015 00:06:54 +0000 (UTC)
- Subject: Re: Force
- Authentication-results: sourceware.org; auth=none
- 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>
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