-
bash problem
Hi,
I have a little problem with bash that I hope someone can help me with.
I have a utility program that I made that use the following syntax:
mdb tag -z -d /path/to/some/directory -d "/path/to/some/other/directory with space" -d /yet/another/one
Now I want to wrap it in a nautilus script
So far I have this:
Code:
IFS=$'\n';
for d in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
do
ARGS="${ARGS} -d \"${d}\"";
done;
mdb tag -z ${ARGS}
however my script report receiving only one argument, which is all the -d enclosed in double quotes
That is the command is launched as :
mdb tag -z " -d dir1 -d dir2 -d dir3"
while I want
mdb tag -z -d "dir1" -d "dir2" -d "dir3"
any ideas?
-
Looks ok except for some reason the IFS as a newline does not seem to be working. Another method would be to use the standard bash argument variables and iterate through the list with a shift