Script loop question

Oliver Marshall Oliver.Marshall at
Thu Nov 12 08:59:43 UTC 2009

Hi chaps,

Can someone point me in the direction of an example that will help me do this?

I have a script that takes an argument (a file name) and performs actions on that file. I want to mod the script so that i can pass, as arguments, multiple filenames and have the script perform the same set of commands on each file in turn, like this;

./ file1 file2 file3


I guess it's bringing the two parts of the loop and the arguments together to loop through each argument in turn, but that's where I get stuck.



G2 Support
Network Support : Online Backups : Server Management

[cid:image001.jpg at 01CA6376.79EA9D30]

Tel:    0845 307 3443
Email:  oliver.marshall at<mailto:oliver.marshall at>
Twitter: g2support<>
Mail:   2nd Floor, 130a Western Rd, Brighton, Sussex, BN12LA

G2 Support LLP is registered at Mill House, 103 Holmes Avenue, HOVE
BN3 7LE. Our registered company number is OC316341.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 1969 bytes
Desc: image001.jpg
URL: <>

More information about the ubuntu-users mailing list