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

Re: sourcing a sh file in zsh



On 25 ÑÐÐÐÑÑ 2009 13:25:34 Richard Hartmann wrote:
> On Sun, Jan 25, 2009 at 09:56, Andrey Borzenkov <arvidjaar@xxxxxxxxx> 
wrote:
> > Actually you can always do
> >
> > foo=$(<<-\HERE
> >        function foo {
> >         ...
> >        }
> >        HERE)
> > emulate -c sh $foo
>
> The problem with that is that it's not immediately apparent that this
> function is intended to be executed in a different emulation.
> Bart's suggestion is a lot easier to read for a third party and will
> thus create less errors.
>

I asked already - why would you want to create non-zsh function inline 
in zsh script?

Anyway, if you really need it

emulate -? sh -c "${$(<<-\HERE
function foo {
...
}
HERE
)}"


Attachment: signature.asc
Description: This is a digitally signed message part.



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