Script for transferring files

Hi Guys,
I have to transfer a few files in my system . The commands to be used are as follows . Will it be possible to send the output of the following in the form of a mail .

cd /export/home/teja
ls -lrt Quote.java*
mv Quote.java Quote.java.20121023
cp /tmp/Quote.java .
ls -lrt ACSOESaveQuote.java* 

The output displayed on the screen when the above commands are run should be copied to a file and sent via mail .
Can you please advice on this .

Not sure if this is what you are looking for:-

# cat mail_cmds.sh
{
 cd /export/home/teja
 ls -lrt Quote.java*
 mv Quote.java Quote.java.20121023
 cp /tmp/Quote.java .
 ls -lrt ACSOESaveQuote.java* 
} > out_cmds.txt

mailx -s "Command O/P" user@domain.com < out_cmds.txt
1 Like

Thanks a lot Bipinajith ....
It worked perfectly ..