The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Some simple question abt Unix kernel melbdavid UNIX for Dummies Questions & Answers 2 06-03-2007 03:06 AM
Simple Windows-to-Unix SCP question Duchesne UNIX for Dummies Questions & Answers 2 04-06-2007 09:21 PM
Simple C question... Hopefully it's simple Xeed High Level Programming 6 12-15-2006 10:29 AM
Ok simple question for simple knowledge... Corrail UNIX for Dummies Questions & Answers 1 11-28-2005 09:03 AM
Simple Unix Question djt0506 Shell Programming and Scripting 1 11-25-2005 12:26 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-10-2005
Registered User
 

Join Date: Dec 2005
Posts: 1
I have a simple unix question

Hello all,
I need to write a little unix script to do some work on multiple files. I need to enter the filenames from the command line (scriptname <filename> <filename>. I have written the code to do double spacing, and some line numbering but it does not take multiple files from the command line. How do I accomplish this? What is the syntax? I used $* to read in all of the args from the command line but it only takes the first filename and ignores the rest. Thanks if anyone can help.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-10-2005
bhargav's Avatar
Registered User
 

Join Date: Sep 2004
Location: USA
Posts: 511
Following piece of code may help ...

Code:
#!/usr/bin/ksh

while test $# -ne 0
do
   echo $1
   shift
done
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:51 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0