![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remove words from file | Beeser | UNIX for Advanced & Expert Users | 5 | 12-19-2008 12:45 PM |
| remove first few words from a line | shellscripter | Shell Programming and Scripting | 4 | 10-08-2008 02:34 AM |
| read arguments from shell | DNAx86 | High Level Programming | 1 | 05-11-2008 12:56 PM |
| Bash Shell - # of arguments | DNAx86 | Shell Programming and Scripting | 1 | 01-10-2008 01:23 PM |
| Shell script with arguments | sankar6254 | Shell Programming and Scripting | 3 | 12-22-2003 09:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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
|
|
||||
|
Quote:
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 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|