Can you access command line args from a source'd script?

Brad Appleton brad at SSD.CSD.HARRIS.COM
Tue Aug 28 01:26:53 AEST 1990


I had to do this once! What I had to do was create an alias:

	alias mycmd "set my_argv = ( \!* ); source myfile"

then `myfile' could go around using `my_argv' like scripts use $argv;
Big drawback to this approach is that you have to be real carefule not
to stomp on things in the environment since you are NOT a separate shell.
You should probably take care to unset any variables that you used and 
be REAL careful not to overwrite any pre-existing variables (unless you
know what you are doing with the variables in question).
______________________ "And miles to go before I sleep." ______________________
 Brad Appleton        brad at travis.ssd.csd.harris.com   Harris Computer Systems
                          ...!uunet!hcx1!brad          Fort Lauderdale, FL USA
~~~~~~~~~~~~~~~~~~~~ Disclaimer: I said it, not my company! ~~~~~~~~~~~~~~~~~~~



More information about the Comp.unix.questions mailing list