bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sourcing a script from a pipe is not reliable


From: Jeremy
Subject: Re: Sourcing a script from a pipe is not reliable
Date: Thu, 10 Jan 2019 18:10:14 -0800

I appreciate the help, Martijn, and I suspect I will find your suggestions
useful in the future, but they do not completely work for us in the present
instance. We are, in part, trying to determine if our script may have lost
its positional parameters because it was invoked by someone else using ".
ourscript --options" in a shell that does not support that, so it does not
help to know they could have done it better some other way.

On Thu, Jan 10, 2019 at 3:29 PM Martijn Dekker <martijn@inlv.org> wrote:

> Op 10-01-19 om 22:52 schreef Jeremy:
> > 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.  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.
>
> While not all shells support passing positional parameters to dot
> scripts, it is very simple to make work for POSIX sh: shell functions
> provide positional parameters, so wrap the dot command in one of those.
> ...
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]