I have a following problem:
#!/bin/bash
NUM=`cat accounts | wc -l`;
for i in {1..$NUM}
do
account=`awk "NR==$i" accounts`;
echo -e "\nAccount: $account\n";
sudo ./backup_maildir $account;
done
"accounts" is a file with regular e-mail addresses, one in each line.
backup_maildir is expect script.
When the main script is executed, the 6th line successfuly echo current mail address, but the following line is not passing that string to backup_maildir script. If the $account variable is user@domain.com, a string that is passed to backup_maildir is {user@domain.com?} ?! How is that possible? How to solve it?
Best Answer
huh what a crazy script :) lets try like this :)
if everything looks fine and sudo line works out of script as expected drop the echo and voila