On 1/10/19 4:52 PM, Jeremy wrote:
> Have you considered reading stdin into a string (if it's one line) or an
> array (if it's more) and using `eval' on it? That obviously works better
> if it's one line, but could be made to work on multiple lines.
>
>
> We are trying to determine if the current shell supports passing positional
> arguments to a script sourced by dot (.), and we are trying to do it in a
> way that will work under pretty much any shell.
Bash does, but it's not portable.
> If you can show me how to
> do that with eval, then that would be great, even though in general I hate
> to ship a script that uses eval.
You have to do it yourself the old-fashioned way, using `set', if you want
to restrict yourself to using `eval'.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/