I'm writing a bash script which needs to, for one step, get a list of directories (variable) in a target directory (which may also contain files), and then expand them out as parameters to a python script.
Example:
/stuff/a dir/
/stuff/b other/
/stuff/c/
And I need to, within a bash script, call:
script.py "a dir/" "b other/" "c/"
or alternately, escaped spaces:
script.py a\ dir/ b\ other/ c/
I need the script to be called exactly once for directory 'stuff'.
Is there a straightforward way to do this kind of thing? I've been googling around and the best I've managed to figure out requires me to know how many directories there are.