Results 1 to 8 of 8
Using a bash scipt
How would you get the number of files in a directory.
Then run a for loop for each of the files in the directory, such that ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-31-2005 #1Just Joined!
- Join Date
- Mar 2005
- Location
- South Africa
- Posts
- 88
Bash question
Using a bash scipt
How would you get the number of files in a directory.
Then run a for loop for each of the files in the directory, such that you can operate on the file?
- 05-31-2005 #2Linux User
- Join Date
- Jul 2004
- Location
- Poland
- Posts
- 368
There's a small subtlety in this question. Do you want files from subdirectories included or not?
"I don't know what I'm running from
And I don't know where I'm running to
There's something deep and strange inside of me I see"
- 05-31-2005 #3
- 05-31-2005 #4Just Joined!
- Join Date
- Mar 2005
- Location
- South Africa
- Posts
- 88
Thanks, That's pretty much what i was trying to do.
- 05-31-2005 #5
The Forum Rules clearly state that we will not do your homework for you, and this thread looks suspiciously like a homework question.
eugrus, I understand that you were trying to be helpful, but posting a program already written for this person is not a precedent that should be set in these forums. If indeed the original poster has asked a homework question, you've effectively helped this person cheat, and therefore not actually learn anything.
Originally Posted by Forum Rules Registered Linux user #270181
TechieMoe's Tech Rants
- 05-31-2005 #6
techieMoe
it is the way to make one understand the technologyposting a program already written
not more
I do not think it is so.homework questions
This is just a thing people really often need, while writing scripts.
- 05-31-2005 #7
I'll leave this to a moderator. As far as I'm concerned this entire post is against the forum rules and should be taken off.
Registered Linux user #270181
TechieMoe's Tech Rants
- 05-31-2005 #8Linux Guru
- Join Date
- Apr 2003
- Location
- London, UK
- Posts
- 3,284
topic locked as the original question has been answered and i don't forsee the conversation going anywhere constructive



