[SunHELP] source'ing and $1

Adrian.Florea at alcatel.ro Adrian.Florea at alcatel.ro
Tue May 6 01:36:31 CDT 2003


Hi,

When you launch the script check for a env var (e.g. MY_FIRST_ARG).
If is set to something (e.g. not empty) then proceed with this as
argument.
When you'll run the script with $1=1 you'll do a export for this env var
with a specified value (in this case 1) and after that you'll find here
the value for subsequent calls. ...


maybe it helps...
Adrian

On Mon, 5 May 2003, Markham, Richard wrote:

> i want to process $1 within a source'd file and then after processing I want
> to set $1 to "".  Otherwise
> when I re'source  the same ~command~ file, it will use the last shell value
> for $1 even when I dont
> specify a value on the command line when calling the source program.
>
> example:
> . testprog 1
> next time ran
> . testprog
> $1 would contain "1"
> so I need $1 to be set to "" at the end of the command file before the next
> source run.
>
> I tried shift but that gives 'bad number' when you run out of parameters.
>
> TIA
> _______________________________________________
> SunHELP maillist  -  SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp



More information about the SunHELP mailing list