The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-17-2008
sam4now sam4now is offline
Registered User
 

Join Date: Apr 2008
Posts: 23
puting arguments into varables

hello all
I am written a script that would put a line of text and a file into two different varables for later use, i.e a script called pimp with any number of words and a filename which is the last argument.

so for eg $pimp my name is the name given to me when i was born Afile
where pimp is the script name
"my name ...... born" is the line of text
and Afile is a name of the file.


I can get the filename since is the last argument but how can i get the remaining argument


this is what i have done.
for arg in "$@"
do
: # nothing
done
echo "the last command line argument is $arg"
Reply With Quote
Forum Sponsor