misterstick
Programmer
AIX 4.3.3
i have a script which i wish to run with and without parameters.
when run without, it should use a default value.
when i run the script first with a parameter, and then without, the second time the script behaves as if there were still one parameter.
example script:
example session:
is there any way to stop this behaviour?
many thanks,
mr s. <![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
i have a script which i wish to run with and without parameters.
when run without, it should use a default value.
when i run the script first with a parameter, and then without, the second time the script behaves as if there were still one parameter.
example script:
Code:
!#/bin/ksh
echo $# $1
example session:
Code:
$ . script.sh parameter
1 parameter
$ . script.sh
1 parameter
$ echo $# $1
1 parameter
is there any way to stop this behaviour?
many thanks,
mr s. <