command line arguments

--------------------------------------------------------------------------------

I have this while loop and at the end I am trying to get it to tell me the last argument I entered. And with it like this all I get is the sentence with no value for $1. Now I tried moving done after the sentence and it printed the value of $1 after every number. I don't want that I just want the last argument entered.

while [ $# -gt 0 ]
do
echo "$#"
shift
sleep 1s
done

echo The last command line argument you entered is $1.

can anyone help?

Double post questions is not allowed, please read the:

Continu here:

Thread closed.