Remove the first two words from shell arguments

Hi
I need to delete first two words from the arguments my script receives .. no matter how many arguments are passed .

Thanks
Praveen

shift 2
third=$1
echo $third

should give you your third argument

Hyy , I need all the remaining argument , not only the third , for eg:- if the total arguments are 7 the output shuld be the last 5 arguments .. and if the total argumetns are 10 thn the o/p shuld be 8 .. hope you got my requirements

Hope this should help you or else would give u an idea on how to proceed...

echo "one two three four" | cut -d " " -f3-
three four

Please correct me if i understood ur problem in a wrong way.... Also give some sample i/p and o/p so that it will be easy to work on it....

shift does exactly what you require. "shift 2" deletes the first two arguments from the argument list, eg. $3 becomes $1, $4 becomes $2, etc. If you want to output all your arguments sans the first two, do this

shift 2
echo "$@"

Hey

You can get the count of total arguments being passed. and then you can preserve all of'em except first 2 arguments using for loop.

echo 'num of args: '$#

following for loop will display all the arguments being passed:
for arg in "$@";
do
echo 'arg: '$arg;
done

You can run the while loop 2 less then the count of $#
var=`$# - 2`

you can then run the loop in reverse order, till value of var is achieved.

Hope you got what I am trying to convey.

Thanks
Varun Gupta
:b: