Automatic email-with Subject line containing the previous date
Hi,
Below is the Query i use to get Automatic mail from unix nohup bteq <pn_store_info_2011.bteq> store_transaction.out 2>&1 & wait /opt/sas/SAS_9.1/sasexe/sas store_transaction.sas wait /*zip SAC_Tire SAC_Tire.xls*/ (cat store-message.txt; uuencode Store_Level_Trans.xls Store_Level_Tran.xls) | mailx -s "Store Level Transaction Report" -r "Automotive " `cat mailpcp_Store.dat` my query is - the subject line should be like "Store Level Transaction Report-April 04/2012" that is i will be running the code daily and my subjcet should contain yesterday date. 2. also my attachment also should have the yesterday date. i Tried few option but not working. Any help would be Great.pls.. pls. help |
date -d yesterday gives yesterday's date. It can be formatted as required using the +FORMAT argument.
|
(cat store-message.txt; uuencode Store_Level_Trans.xls Store_Level_Tran.xls) | mailx -s "Store Level Transaction Report"date -d yesterday -r "Automotive " `cat mailpcp_Store.dat`
I tried the above one- but i didnt recieve the mail.also my Attachment Store_Level_Trans.xls should be Store_Level_Trans_Yesterday.xls .. New to coding- so pls. help |
Any help on the above said issue..
|
got what i needed-
----------------- yest=$(TZ=EST24EDT date '+%x') yest1=$(TZ=EST24EDT date '+%Y%m%d') mv Store_Level_Trans.xls Store_Level_Trans_$yest1.xls (cat store-message.txt; uuencode Store_Level_Trans_$yest1.xls Store_Level_Trans_$yest1.xls && uuencode Query_Used.txt Query_Used.txt) | mailx -s "Store Level Transaction Report on $yest " -r "Automotive " `cat mailpcp_Store.dat` ----------------------------- Worked !! |
All times are GMT -5. The time now is 03:22 AM. |