Operating System - HP-UX
1825793 Members
2184 Online
109687 Solutions
New Discussion

Re: Undesirable filename for the HTML attachment

 
SOLVED
Go to solution
Chandrakumar Karunamoor
Occasional Advisor

Undesirable filename for the HTML attachment

Hi all,
When I use the following command in my shell script, the HTML file (attachment) name is the whole path name from root, with underscores instead of "/". My command is

uuencode ${GDB_EXTFILE_ROOT}/Report.html ${GDB_EXTFILE_ROOT}/Report.html | mailx
-s "DAP192 Monthly Guest Direct Mail Campaign Contacts Reporting" `cat ${GDB_SCRIPTS_DIR_N}/${GDB_MAILING_LIST}`

where GDB_EXTFILE_ROOT and GDB_SCRIPTS_DIR_N are parameters which contains the directory names.
GDB_MAILING_LIST is a file that contains the email ids. The full path of the HTML file in test environment is /gdishared/temp/incoming/dap192/data/Report.html. So the HTML file name comes as _gdishared_temp_incoming_dap192_data_Report.html in the email. I want the attachement to be named as Report.html alone. FYI, I cannot remove the parameter GDB_EXTFILE_ROOT. Please let me know your suggestions.
Thank you,
Chandra
2 REPLIES 2
Abdul Rahiman
Esteemed Contributor
Solution

Re: Undesirable filename for the HTML attachment

Hi,

The second argument on the uuencode command specifies the filename of the uuencoded output of the file. What uuencode does is, it inserts the entire text in the second argument as the name of the encoded output and output to the std out.

Therefore, if you modify the second argument to have just the desired filename (Report.html), you should have the desired output.

Try this way,
uuencode ${GDB_EXTFILE_ROOT}/Report.html Report.html | mailx
-s "DAP192 Monthly Guest Direct Mail Campaign Contacts Reporting" `cat ${GDB_SCRIPTS_DIR_N}/${GDB_MAILING_LIST}`

HTH,
Rahman.
No unix, no fun
Chandrakumar Karunamoor
Occasional Advisor

Re: Undesirable filename for the HTML attachment

It works! Thank you.