supremum supremum - 1 year ago 145
Bash Question

Shell script input directory

I am trying to make enqueue a directory in audacious. For that I want to make a shell script which will take the input I am giving as the directory to enqueue.

find . -iname \*.mp3 -print0 | xargs --null audacious --enqueue
this will enqueue all the files in the current directory. I want to make a shell script which takes the input for current directory.

Answer Source

Assuming that when you say "input" you're referring to command-line arguments:

exec find "$@" -iname '*.mp3' -exec audacious --enqueue '{}' +
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download