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
MMAP2(2)						     Linux Programmer's Manual							  MMAP2(2)

NAME
mmap2 - map files or devices into memory SYNOPSIS
#include <sys/mman.h> void *mmap2(void *addr, size_t length, int prot, int flags, int fd, off_t pgoffset); DESCRIPTION
The mmap2() system call operates in exactly the same way as mmap(2), except that the final argument specifies the offset into the file in 4096-byte units (instead of bytes, as is done by mmap(2)). This enables applications that use a 32-bit off_t to map large files (up to 2^44 bytes). RETURN VALUE
On success, mmap2() returns a pointer to the mapped area. On error -1 is returned and errno is set appropriately. ERRORS
EFAULT Problem with getting the data from userspace. EINVAL (Various platforms where the page size is not 4096 bytes.) offset * 4096 is not a multiple of the system page size. mmap2() can return any of the same errors as mmap(2). VERSIONS
mmap2() is available since Linux 2.3.31. CONFORMING TO
This system call is Linux-specific. NOTES
Nowadays, the glibc mmap() wrapper function invokes this system call rather than the mmap(2) system call. On ia64, the unit for offset is actually the system page size, rather than 4096 bytes. SEE ALSO
getpagesize(2), mmap(2), mremap(2), msync(2), shm_open(3) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2008-04-22 MMAP2(2)
All times are GMT -4. The time now is 06:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy