Sponsored Content
Top Forums Shell Programming and Scripting Identify Color and send email with same color Post 302893964 by Kingcobra on Saturday 22nd of March 2014 12:44:41 PM
Old 03-22-2014
Identify Color and send email with same color

Hello mates,

I have a requirement where in which I have to mail an output from multiple programs in the same colour as the output from shell script.

I have seen a post to mail html in our forum,but my case is I have to first identify which colour the output is in an then mail it to in the same color ,guys please help me this question has become more of a conundrum to me Smilie.


Regards
Kingcobra

---------- Post updated 03-23-14 at 12:11 AM ---------- Previous update was 03-22-14 at 09:37 PM ----------
Code:
ls -lrt>king.txt;txt2html king.txt
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta name="generator" content="HTML::TextToHTML v2.51"/>
</head>
<body>
<p>total 88<br/>
-rw-r--r-- 1 mulpuri mulpuri 8445 Feb 24 00:16 examples.desktop
drwxr-xr-x 2 mulpuri mulpuri 4096 Feb 24 00:19 Videos
drwxr-xr-x 2 mulpuri mulpuri 4096 Feb 24 00:19 Templates
drwxr-xr-x 2 mulpuri mulpuri 4096 Feb 24 00:19 Public
drwxr-xr-x 2 mulpuri mulpuri 4096 Feb 24 00:19 Pictures
drwxr-xr-x 2 mulpuri mulpuri 4096 Feb 24 00:19 Music
drwxr-xr-x 2 mulpuri mulpuri 4096 Feb 24 00:19 Documents
drwxr-xr-x 6 mulpuri mulpuri 4096 Mar 11 21:27 Downloads
drwxrwxr-x 6 mulpuri mulpuri 4096 Mar 22 12:07 workspace
-rw-rw-r-- 1 mulpuri mulpuri 1988 Mar 22 13:07 kart.txt
drwxr-xr-x 2 mulpuri mulpuri 4096 Mar 22 21:27 Desktop
-rw-rw-r-- 1 mulpuri mulpuri 681 Mar 23 00:06 king
-rw-rw-r-- 1 mulpuri mulpuri 0 Mar 23 00:06 king.txt</p>

</body>
</html>

I can convert the text to html,by where I am struck is that I need to retain the color;all of us are aware that with default settings in ubuntu directories will be in blue color however when I convert and mail the content taht will be plain white;please help me finding the answer to this question

Last edited by Scott; 03-22-2014 at 01:47 PM.. Reason: Please use code tags
 

2 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to change the background color in the init 3 mode(not line color)

Hello, I am using RHEL 6.1 on VMware I am searching for a way to change background color (not line by line color wich one can using tput command) basically changing the color of the whole screen to white instead of the default black and changing font color to black and alos would like to... (2 Replies)
Discussion started by: Dexobox
2 Replies

2. Shell Programming and Scripting

Send mail with font color change

Hi All, I have a file that contains following entries. I want to highlight the line that has word as "FAILURE" while sending the email. File ------------------------------------------------------------ Job Name: ABC Start Time: 07/20/2019 07:32:39 End Time: 07/20/2019... (4 Replies)
Discussion started by: sdosanjh
4 Replies
SHAR(1) 						    BSD General Commands Manual 						   SHAR(1)

NAME
shar -- create a shell archive of files SYNOPSIS
shar file ... DESCRIPTION
shar writes an sh(1) shell script to the standard output which will recreate the file hierarchy specified by the command line operands. Directories will be recreated and must be specified before the files they contain (the find(1) utility does this correctly). shar is normally used for distributing files by ftp(1) or mail(1). SEE ALSO
compress(1), mail(1), tar(1), uuencode(1) BUGS
shar makes no provisions for special types of files or files containing magic characters. EXAMPLES
To create a shell archive of the program ls(1) and mail it to Rick: cd ls shar `find . -print` | mail -s "ls source" rick To recreate the program directory: mkdir ls cd ls ... <delete header lines and examine mailed archive> ... sh archive HISTORY
The shar command appears in 4.4BSD. SECURITY CONSIDERATIONS
It is easy to insert trojan horses into shar files. It is strongly recommended that all shell archive files be examined before running them through sh(1). Archives produced using this implementation of shar may be easily examined with the command: egrep -v '^[X#]' shar.file 4.4BSD June 6, 1993 4.4BSD
All times are GMT -4. The time now is 01:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy