This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Force


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]