Quote:
Originally Posted by praveenbvarrier
Hi
I need to delete first two words from the arguments my script receives .. no matter how many arguments are passed .
Thanks
Praveen
|
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
