Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Making a script 'sourceable'
- X-seq: zsh-users 7971
- From: Lloyd Zusman <ljz@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Making a script 'sourceable'
- Date: Fri, 03 Sep 2004 13:01:02 -0400
- Cancel-lock: sha1:6AITYQBdcls+U2juUWIvrB9gLUQ=
- Cc: DervishD <disposable1@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040903163509.GA12618@DervishD>
- Sender: news <news@xxxxxxxxxxxxx>
DervishD <disposable1@xxxxxxxxxxxxxx> writes:
> [ ... ]
>
> So I must, by hand, restore any changed variables, options and,
> what more? Must I restore any other thing? Is there any simple way of
> making scripts source-safe or source-aware?
>
> Thanks a lot in advance :)
>
> Raúl Núñez de Arenas Coronado
¡Hola Raúl! Espero que te encuentres muy bien.
I'm not sure if this handles the case that you're concerned about, but
when I want to make a script "sourceable" as well as executable, I do
this:
#!/bin/zsh
(
# all script stuff goes here
)
Yes, it causes an extra fork, but that's the price I pay for this dual
sourceable/executable capability.
--
Lloyd Zusman
ljz@xxxxxxxxxx
God bless you.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author