The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Remove the first two words from shell arguments
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Remove the first two words from shell arguments
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
5
(
permalink
)
02-11-2009
pludi
Moderator
Join Date: Dec 2008
Location: .at
Posts: 1,884
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
Code:
shift 2 echo "$@"
pludi
View Public Profile
Find all posts by pludi
Find pludi's past nominations received
Find pludi's present nominations given