Something along this line should suffice..

#!/bin/sh
for file in $HOME/*; do echo $file; done

'man for' should take you there.

--SH

-----Original Message-----
From: Lloyd Bayley [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 13 August 2002 11:21 AM
To: [EMAIL PROTECTED]
Subject: [SLUG] Looping Through File Lists


Hi again People!

This time, it's another basic question I'm afraid....
I've had a crack at it but I feel I'm in the wrong territory trying to use 
'for'...:)

I'm trying to basically run a command on every file in the current
directory.
Some pseudocode...
----

for everyfileincurrentdir
do
        convertfile (filename)
done

----

I just want to run the command once on/for every file in the 
directory....As I said, the 'for' - type loop is starting to look like the 
wrong place to be.

Sorry about the basic question again, I'm getting there! :)


Cheers,

Lloyd. :-)

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to