shell programming - loopsUsually, this is good enough for looping through files by name: for i in `find . -type f -name \*.jar`; do (jar tvf $i | glark --label=$i org.incava.util.Something.class); done But that does not work with files with spaces in them, because find breaks them apart as separate arguments, such as MP3s automatically named by their artist, album, and titles. So this works instead: find . -type f -name \*.mp3| while read i; do cp --parents $i /media/MP3Player; done |
|