All the above suggestions seem good. Howver, if you're doing complex(ish) things with the ls to only choose certain files, piping find into your script might be better. For instance: $ find . -name 'mp3s' | mp3concat -s 700
Then, in your script, instead of reading @ARGV, just read STDIN.