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

Re: sourcing a sh file in zsh



On Jan 24,  6:59pm, Andrey Borzenkov wrote:
}
} >   emulate -LRE sh source file.sh
} 
} What about the following patch. It simply eval's any code after setting 
} requested emulation. As a bonus it prints current emulation if no argument 
} is specified.

This looks a lot like what I had in mind, yes.

} Neither should be of compatibility issues as emulate always 
} allowed exactly one argument.

Agree.

} Comments?

I'm still undecided on (1) whether "-E" should either require or always
imply -L, and (2) whether I like "-c" better, as in

    emulate sh -c 'source file.sh'

As to (1), in what circumstances would you want to eval a command
under emulation and then leave the emulation in place?  If you were
going to leave emulation turned on anyway, why wouldn't you write
it as

    emulate sh
    source file.sh

??

(2) is a nit.  Mainly it affects whether emulate accepts only one argument
to be eval'd.



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