Mail utility not displaying escape sequences


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mail utility not displaying escape sequences
# 1  
Old 10-18-2012
Mail utility not displaying escape sequences

Hello! I created a file that displays text underlined. However when I pass the file into the mail utility it doesnt display the underline.

Here is the code:

echo "\n\033[4mUsername Timestamp Terminal\033[0m" > test_underline.txt

cat test_underline.txt

mail -s "testing of underline" <email_address> < test_underline.txt

Any ideas?

Thanks!
# 2  
Old 10-18-2012
I don't think this will work, you can use html instead:-

Code:
echo "<html><body><u>Username Timestamp Terminal</u></body></html>" > test_underline.html

Code:
cat test_underline.html | mailx -m -s "testing of underline 
Content-Type: text/html" <email_address>

# 3  
Old 10-18-2012
I have never done HTML before. Do I use the exact synatx?

cat test_underline.html
<html><body><u>Username Timestamp Terminal</u></body></html>
# 4  
Old 10-18-2012
Yes, please try the syntax which I provided.

HTML <u> tag is used to define underlined text.
# 5  
Old 10-18-2012
Here is the echo command verbatim.

/scripts : echo "<html><body><u>Username </u></body></html>"
<html><body><u>Username </u></body></html>
# 6  
Old 10-18-2012
So have you received the email with underlined text?
# 7  
Old 10-18-2012
Nope - this is what is displayed as my mail message.

<html><body><u>Username Timestamp Terminal</u></body></html>


I am using mail not mailx.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX/Linux - awk - displaying unxpected ! character when viewed in mail; but not in actual file

Greetings Experts, I am on AIX using ksh; I am processing the input files and generating a awk_output.txt file using AWK. By reading that awk_output.txt file, I am building a output.html file which is cat and then fed to /usr/sbin/sendmail .When the shell script is triggered through command... (2 Replies)
Discussion started by: chill3chee
2 Replies

2. UNIX for Beginners Questions & Answers

UNIX mail utility

Hi, I work on a Middleware application which is installed on Windows, but its file System is on HP UNIX. I am supposed to change the SMTP host address for my application. But I am not able to find the file where the old SMTP host would have been configured/hardcoded. Can anyone assist me on this... (2 Replies)
Discussion started by: jhilmil
2 Replies

3. Shell Programming and Scripting

How to remove escape sequences from a text file?

Hello friends, Could anyone please advise on how to remove escape sequences from a text file? $ file input.txt input.txt: ASCII English text, with escape sequences I'm able to see those escape characters when opened in vi editor like shown below: ^ but not when I run more... (6 Replies)
Discussion started by: magnus29
6 Replies

4. Shell Programming and Scripting

Escape Sequences

Hi Gurus, Escape sequences \n, \t, \b, \t, \033(1m are not working. I just practiced these escape sequences. It worked first. Later its not working. Also the command - echo inside the script editor shows as shaded by a color. Before that echo inside the script editor wont show like this.... (4 Replies)
Discussion started by: GaneshAnanth
4 Replies

5. Shell Programming and Scripting

Auto escape script to escape special chars in script args

This is a bit off the wall, but I often need to run scripts where there are argument values that contain special characters. For example, $ ./process.exe -t M -N -o temp.mol.s -i ../molfiles/N,N\',N\'\'-trimethylbis\(hexamethylene\)triamine.mol && sfile_space_to_tab.sh temp.mol.s temp.s It... (1 Reply)
Discussion started by: LMHmedchem
1 Replies

6. Red Hat

Problem with mail utility on linux

Hi, I am facing problem with "mail" utility on redhat linux. If I use ~c in a file and use that file as imput to mail, the mail is not sent to the adrress after ~c. Instead ~c apears in the mail content itself. $ mail a@mycompany.com < temp $ cat temp ~c abc@mycompany.com this is... (7 Replies)
Discussion started by: shriashishpatil
7 Replies

7. UNIX for Dummies Questions & Answers

How to input escape sequences in Linux tty?

More details: Unicode, Framebuffer. I tried to press Esc and then what should follow, letters or brackets, but seems not to work. Probably i do something wrong. If somebody is familiar with escape sequences in the console, how do you do that? Thanks in advance. (4 Replies)
Discussion started by: Action
4 Replies

8. UNIX for Dummies Questions & Answers

Escape Sequences appearing in scripts

I hope this question isn't too vague... i recently switched from RedHat to Solaris 10, and found that the parts of a script that copy files between directories no longer work because escape sequences are appearing at the start and end of the filenames being read #!/usr/bin/bash cd... (1 Reply)
Discussion started by: jwm-wm
1 Replies

9. Solaris

Available escape sequences

:) Hi, Can any one help me to find available escape sequences in UNIX shell programming? ( Like \n, \c etc,. in C or C++) Iam generating one report using one of the script, in that it is very much essential. Regards, LOVE (6 Replies)
Discussion started by: Love
6 Replies
Login or Register to Ask a Question