Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Alias call in function fails...




> On Jun 24, 2020, at 4:28 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> 
> Perry Smith wrote on Tue, Jun 23, 2020 at 19:47:05 -0500:
>> 
>> 
>>> On Jun 23, 2020, at 6:43 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>>> 
>>> On Tue, Jun 23, 2020 at 4:30 PM Perry Smith <pedz@xxxxxxxxxxxxxxxx> wrote:
>>>> 
>>>> Ahh… ok.  Thank you.  I remember reading that now (before your changes)
>>>> but didn’t really ingest it.
>>> 
>>> The more classic example is something excessively abbreviated such as
>>> 
>>> % alias -g L='|less'
>>> % find ~ -name \*.gif L
>> 
>> For me, I think I would more likely do something like:
>> 
>> % alias -g opts=“-a -b -c -d”
>> % foo opts path/to/file
>> 
>> But, given my relative inexperience with zsh, I not think about alias -g and
>> would likely do:
>> 
>> % opts=“-a -b -c -d”
>> % foo $opts path/to/file
>> 
>> or use alias -g to save a really long ugly path.  etc.
>> 
> 
> The second example won't work with the default settings (see
> http://zsh.sourceforge.net/FAQ/zshfaq03.html#l18).  The standard
> workaround is to use an array variable, and I'd like the example to show
> a use of aliases that can't easily be achieved without them.  (This also
> goes for Grant's example.)

Ah… yes, you are right of course.  It demonstrates that my mind is still
using bash.



Messages sorted by: Reverse Date, Date, Thread, Author