Shell script saving to file oddly

62 views Asked by At

I've written a simple shell script.

count=`mailq -v`
var=$(mailq -v)
echo "$var" > /home/xxxxxx/textis.txt

It works fine and outputs the result of mailq to the txt file no problem. However when I add one line and change it to

count=`mailq -v`
var=$(mailq -v)
echo "$var" > /home/xxxxxx/textis.txt
(cat mailtext; uuencode /home/xxxxxx/textis.txt /home/xxxxxx/textis.txt) |
    mail -s "Mail Queue alert" [email protected]

Which just adds the mailing line it now doesn't update the file.

I'm really new at shell scripts and have been trying to figure this out for a day now so any help would be great

0

There are 0 answers