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
DBS-EDIT-PATCH(1)						Debian Build System						 DBS-EDIT-PATCH(1)

NAME
dbs-edit-patch - Edit a DBS patch SYNOPSIS
dbs-edit-patch [options] patch dbs-edit-patch -h|--help DESCRIPTION
dbs-edit-patch is script to generate or modify patches for Debian source-packages in DBS format. WARNING
dbs is deprecated, please switch to the `3.0 (quilt)' Debian source package format instead. See http://wiki.debian.org/Projects/Deb- Src3.0#FAQ for a short guide how to do it. OPTIONS
-h, --help Show summary of options. -t dir, --tmpdir=dir Directory for the temporary files, default is /tmp or if set $TMP. -s dir, --sourcedir=dir Top level directory of the debian-package source-tree, default is the present working directory. -P dir, --sourcepatchdir=dir Directory containing upstream patches. -T dir, --sourcetardir=dir Directory containing the upstream tarball. -p level, --strip=level Striplevel -p of patch (Option -p of diff(1)), accepted values are 0 and 1, default is 0. ENVIRONMENT VARIABLES
TMP Sets the directory for the temporary files, can be overridden with -t dir. debian/vars dbs-edit-patch will automatically use variables defined in the optional debian/vars file. When a file debian/vars.in exists and debian/vars either does not exist or is older than any of the following files: debian/vars.in, debian/changelog, debian/rules or debian/control, then dbs-edit-patch will try updating the vars file by running the following command make -f debian/rules -W debian/vars.in debian/vars EXAMPLES
Edit the 021_debian patch of Heimdal: ~/heimdal-0.3d> dbs-edit-patch -t/tmp 021_debian Extracting source heimdal-0.3d.tar.gz ... successful. Applying patch 001_replay ... successful. etc. Copying heimdal-0.3d to heimdal-0.3d-old ... successful. Applying patch 021_debian ... successful. Edit files under /tmp/021_debian/heimdal-0.3d as required, then put a short description into /tmp/021_debian/patch-description if desired, and finally execute /tmp/021_debian/dbs-update-patch to save the results. Technical note: dbs-edit-patch extracts all patches before 021_debian into /tmp/021_debian/heimdal-0.3d, copies the result to /tmp/021_debian/heimdal-0.3d-old, and applies the last patch 021_debian (if it exists). Also, it creates a shell script which will create the diff between the old and new directories: ~/heimdal-0.3d> ls -la /tmp/021_debian total 12 -rwxr-xr-x 1 bam users 112 Jan 31 13:31 dbs-update-patch* -rw-r--r-- 1 bam users 0 Jan 31 13:31 patch-description drwxr-xr-x 14 bam users 4096 Jan 31 13:31 heimdal-0.3d/ drwxr-xr-x 14 bam users 4096 Jan 31 13:31 heimdal-0.3d-old/ drwxr-xr-x 5 bam users 4096 Jan 31 13:31 .stampdir/ ~/heimdal-0.3d> cat /tmp/021_debian/dbs-update-patch #!/bin/sh -e cd "/tmp/021_debian" HOOK_DIR="/usr/src/heimdal/debian/dbs-hooks" test -d "$HOOK_DIR" && run-parts "$HOOK_DIR" --arg update-patch-prediff find -name "*.bak" -print0 | xargs -0 --no-run-if-empty rm find -name "*~" -print0 | xargs -0 --no-run-if-empty rm : > new_patch test ! -e patch-description || cp patch-description new_patch diff -ruN heimdal-0.3d-old heimdal-0.3d >> new_patch || test $? -eq 1 mv new_patch /usr/src/heimdal/debian/patches/021_debian test -d "$HOOK_DIR" && run-parts "$HOOK_DIR" --arg update-patch-postdiff SEE ALSO
diff(1), dbs(7), /usr/share/doc/dbs/ AUTHOR
DBS was written by Adam Heath, modified by Ben Collins, modified and packaged for Debian by Brian May. This manpage was generated by Andreas Metzler and modified by Robert Luberda. Debian February 15th, 2011 DBS-EDIT-PATCH(1)
All times are GMT -4. The time now is 04:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy