[SunHELP] source'ing and $1
Mon May 5 21:17:15 CDT 2003
what I have observed is that with KORN shell it is retaining the last $1
value from the last source.
i was curious if there was a way to manipulate the value of $1 from command
line.
-----Original Message-----
From: Lumpkin, Buddy [mailto:Buddy.Lumpkin at nordstrom.com]
Sent: Monday, May 05, 2003 6:32 PM
To: Markham, Richard; sunhelp at sunhelp.org
Subject: RE: [SunHELP] source'ing and $1
If I recall correctly, when you source a file, it gets the argument that was
passed to the calling program, not to the sourced file. That might be shell
specific though
-----Original Message-----
From: Markham, Richard [mailto:RMarkham at hafeleamericas.com]
Sent: Monday, May 05, 2003 12:15 PM
To: 'sunhelp at sunhelp.org'
Subject: [SunHELP] source'ing and $1
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