ok people, stop fighting over my question...
bakunin - I appologize. I did not "state" that the problem was in AIX, I merely tried to imply it by placing the question in the AIX Forum - and it seems that that still mis-characterizes it since it's really a ksh issue.
I did find an answer to my question - which was
An answer is to use the following:
set --
or, as was pointed out earlier by bakunin, use the shift command to shift the positional parameters until they are all empty. For what I am looking for, set -- is more efficient.
Ok - let's lay this out this issue/question a bit better. My issue is that when I am dot-running a script over and over, I don't want the positional parameters to persist in my session. If they do, then I can never re-dot-run the script - or any other script - with NO parameters. In addition, my actual script is scrutinizing the $1 parameter and checking for specific values - so just passing in a "" as the first parameter actual fails my check and spit out a USAGE message explaining how to use the script. The first positional parameter is used to activate optional functions within the script. To just run the script "normally" without the optional features, you don't pass in a parameter.
And there in lies my problem.
The solution for me was to set a Variable=$1 (and repeating that for all other passed in parameters as needed) and immediately issuing set --. This clears all positional parameters that were permanently set for my current environment/session (due to the use of dot-run).
Problem solved.
Now - to address some of the other comments/assertions being made in the other comments/replies posted here:
Here's some new code for testme which shows an example of how I am checking the value of $1 in my "real script" (which I have still not shown you - but we are trying to keep things simple here).
echo 1=$1
if [[ $# > 0 ]]
then
if [[ ! "${1}" = "DB" ]]
then
echo "There was at least 1 Parameter passed into this script and \$1 was not \"DB\". "
else
echo "There was at least 1 Parameter passed into this script and \$1 was \"DB\" "
fi
else
echo "There were no parameters passed into this script"
fi
Now run these commands and observe the output.
First, let's clear all positional parameters:
set --
Now let's start our experiment:
. testme
There were no parameters passed into this script
. testme DB
There was at least 1 Parameter passed into this script and $1 was "DB"
. testme
There was at least 1 Parameter passed into this script and $1 was "DB"
The above output shows that $1 persists in the current environment. This is NOT the behavior I need/want.
. testme ""
There was at least 1 Parameter passed into this script and $1 was not "DB"
The above output shows that $1 is not empty and thus fails the test
if [[ ! "${1}" = "DB" ]]
This is NOT the behavior I need.
This also shows that $1 is available in your current environment/session. To further prove this, run the following commands:
. testme DB
There was at least 1 Parameter passed into this script and $1 was "DB"
echo 1=$1
1=DB
The value in $1 would persist and potentially mess with other scripts ONLY when those scripts are dot-run. I hope you would agree that this is NOT a desirable behavior. set -- takes care of that behavior by wiping clean all positional parameters ($1, $2, $3, etc)