Fermulator
Programmer
Having trouble getting exec to work with a dynamic set of arguments for the binary it's execing.
Example:
This works, and the tar file is created.
However, what if the 'arguments' passed into tar might change based on version?
Always results in "Reason: tar: ... ... : No such file or directory"
Any ideas how to accomplish this?
Thanks!
Example:
Code:
exec tar -cvf /tmp/MYFILE.tar /dir/to/tar
This works, and the tar file is created.
However, what if the 'arguments' passed into tar might change based on version?
Code:
# If tar is newer, use this syntax:
set tarArgs "-X /tmp/tar-exclude-file -cvvf /tmp/MYFILE.tar /dir/to/tar"
# If tar is older, use this syntax:
set tarArgs "-Xcvf /tmp/tar-exclude-file /tmp/MYFILE.tar /dir/to/tar"
# Now do the tar creation
exec tar $tarArgs
Always results in "Reason: tar: ... ... : No such file or directory"
Any ideas how to accomplish this?
Thanks!