Re: replacement for clyde

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Fri, Aug 19, 2011 at 12:28 PM, Vitor Eiji Justus Sakaguti
<vitoreiji0@xxxxxxxxx> wrote:
> On Fri, Aug 19, 2011 at 2:13 PM, Kazuo Teramoto <kaz.rag@xxxxxxxxx> wrote:
>> On Fri, Aug 19, 2011 at 11:08 AM, Vitor Eiji Justus Sakaguti
>> <vitoreiji0@xxxxxxxxx> wrote:
>>>    # Better yaourt
>>>    yaourt () {
>>>        if [[ $# == 0 ]]
>>>        then
>>>            /usr/bin/yaourt -Sayu
>>>        else
>>>            /usr/bin/yaourt $@
>>>        fi
>>>    }
>>>
>>>
>>
>> For something more terse:
>>
>> yaourt () { yaourt ${@:--Sayu}; }
>
> Looks nice, thanks! But it should be
>  yaourt () { /usr/bin/yaourt ${@:--Sayu}; }
> or we are trapped in and endless loop.

this isn't doing quite what you think.  ${@:--Sayu} is functionally
equivalent to ${1:--Sayu} ... it's only testing the first argument
though it probably works fine for the use case.

and you can use the bash keyword `command` to suppress function lookup
and avoid a loop, but still use $PATH.

-- 

C Anthony


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux