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

Re: Factoring out code



    Hi Bart :)

 * Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> dixit:
> On Sep 6, 12:37pm, DervishD wrote:
> }
> }     So, how can I make a function to use the *global* argv and not
> } the local one? Can a function modify the global argv?
> 
> You can't, and no.
> 
> The only thing you could do would be to establish a convention, such
> as the one with reply/REPLY, and always remember to "set -- $reply"
> after calling one of those functions.

    That's exactly what I was testing right now ;) But the aliases
solution is better for most of the commands, which are simple
oneliners. I need to do a bit more coding to see what things to put
in each alias.

> Your scripts would still end up looking more like the example with
> multiple dot-commands, but you can put all the alias definitions
> in one file.

    I'll do that way, thanks a lot Bart :))))

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...



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