MY goal is to call the following command:
(echo "test";uuencode testfile1.txt testfile1.txt;uuencode testfile2.txt testfile2.txt)|mail -s "subject" "[email protected]"
calling it in the shell works as expected.
However, I would like to do so, when the uuencode commands are stored in an array:
ARR=("uuencode testfile1.txt testfile1.txt" "uuencode testfile2.txt testfile2.txt")
I've tried the following:
STR=$(IFS=';'; echo "${ARR[*]}");
(echo "test";"$STR")|mail -s "subject" "[email protected]"
but I keep on getting the following error:
uuencode testfile1.txt testfile1.txt;uuencode testfile2.txt testfile2.txt: command not found
How to fix this?
I guess it is not recognizing ; as a command separator