Parse contents of directory to bash command in a script

Posted by ECII on Stack Overflow See other posts from Stack Overflow or by ECII
Published on 2012-09-03T09:34:14Z Indexed on 2012/09/03 9:38 UTC
Read the original article Hit count: 162

Filed under:

I have the directory ~/fooscripts/ and inside there are foo1.txt, foo2.txt, etc etc

I have a command that takes the file foo1.txt as input and does some calculation. The output location etc is handled internally in fooprog

fooprog -user-data=foo1.txt

I would like to automate the whole thing in a bash script so that the script will parse all txt files in ~/fooscripts/ sequentially. I am a newbie in bash. Could anyone give me a hint?

© Stack Overflow or respective owner

Related posts about bash