1
I have the following appointment:
#!/bin/bash
db="bats";
table="promotion";
dbHost="192.168.0.246";
dbUser="root";
dbPass="root";
result=`mysql -h $dbHost --user=$dbUser --password=$dbPass --skip-column-names -e "SELECT name FROM $db.$table WHERE finish > now() ORDER BY promotion_key DESC"`
campanha=$(echo $result | tr " " "\n")
echo "$campanhas"
I want to take this result and send by email, ?
I tried that too:
sendmail -s "CAMPANHAS" [email protected] < $campanha
Plus gave the following mistake:
./query.sh: line 14: $campanha: ambiguous redirect