Sponsored Content
Top Forums UNIX for Beginners Questions & Answers HTML color code and tabluar issue Post 302986116 by mirwasim on Sunday 20th of November 2016 09:32:39 AM
Old 11-20-2016
HTML color code and tabluar issue

input data in a file
Code:
servic webservice.somthing 200 OK
servic1 webservice.somthing 200 OK
servic1 webservice.somthing 400 BAD REQEST

Below script is making tabular form perfectly. but there are two thing i am not able to achive
1.how can i color the complete row as red when it see '400' in the row, eg line 3rd from the file.
2 BAD REQUEST have space in between, and because of that BAD is coming in one column and REQUEST is coming in another, how can i get this BAD REQUEST in one column

Code:
echo "<br />"  > output.html
echo "<html>" >> output.html
echo "<Body>" >> output.html
nawk 'BEGIN{print "<table border="1">"} 
          {print "<tr>";
                  for(i=1;i<=NF;i++)print "<td>" $i"</td>";
                  print "</tr>"} END{print "</table>"}' output.txt  >> output.html
echo "</Body>" >> output.html
echo "</html>" >> output.html
echo "<br />"  >> output.html

 

6 More Discussions You Might Find Interesting

1. Solaris

Color issue

On most of my Sun Blade 100 and Ultra 5 systems running Solaris 9, I am having a problem with my video. The CDE looks fine but as soon as I open up Netscape 7 everything except the browser window changes to very bright and ugly colors. This is happening on multiple freshly installed systems w/... (1 Reply)
Discussion started by: meyersp
1 Replies

2. UNIX for Dummies Questions & Answers

Color code my vi

i am running under ssh i want to know how to make vi color code my bash scripting like how do i setup vim in ssh (1 Reply)
Discussion started by: jafa401
1 Replies

3. Shell Programming and Scripting

Handle color code

p1=text1 p2=text2(in red color) when i am trying to replace $p1 with $p2, content of the file from text2 become red. so when i open that file using vi its showing color code before tex2. please suggest me how to omit that color code and make content of that file in default color? (1 Reply)
Discussion started by: Biplab
1 Replies

4. Shell Programming and Scripting

Issue to attachment with HTML body

HI Team, I used below code to get attachment with HTML body. i having21062013.csv file . but i am getting junk .csv file. Can you please help me out. export MAILTO=rp908@gmail.com.com export SUBJECT="Test Waiver Code email" export BODY=test.html export ATTACH=21062013.csv... (4 Replies)
Discussion started by: Jewel
4 Replies

5. Shell Programming and Scripting

Add Color To html Doc

I have a script which converts a .csv file to html nicely. Trying to add 3 colors, green, yellow and red to the output depending upon the values in the cells. Tried some printf command but just can't seem to get any where. Any ideas would be appreciated. nawk 'BEGIN{ FS="," print ... (7 Replies)
Discussion started by: jimmyf
7 Replies

6. Shell Programming and Scripting

Cell color based on Status in HTML output

Hi, I need to get the Status Column in Green if it is approved and Red if it is declined in the HTML output attachment#!/bin/bash body_csv="/authlistener/ProdA/service/queryRS.csv" body_html="/authlistener/ProdA/service/queryRS.html" ... (1 Reply)
Discussion started by: maddelav
1 Replies
badsect(8)						      System Manager's Manual							badsect(8)

NAME
badsect - Creates files to contain bad sectors SYNOPSIS
/usr/sbin/badsect bbdir sector... DESCRIPTION
The badsect command makes a file to contain a bad sector. Normally, bad sectors are made inaccessible by the standard formatter, which provides a forwarding table for bad sectors to the driver. If a driver supports the bad blocking standard, it is preferable to use that method to isolate bad blocks because the bad block forwarding makes the disk appear perfect, and such disks can then be copied with dd(1). The technique used by badsect is also less general than bad block forwarding, as badsect cannot make amends for bad blocks in the i-list of file systems or in swap areas. On some disks, adding a sector that is suddenly bad to the bad sector table currently requires the running of the standard formatter. Thus, to deal with a newly bad block or on disks where the drivers do not support the bad-blocking standard, badsect can be used to good effect. Use the badsect command on a quiet file system in the following way: Mount the file system and change to its root directory. Make a direc- tory BAD there. Run badsect, giving as argument the BAD directory followed by all the bad sectors you wish to add. (The sector numbers must be relative to the beginning of the file system, as reported in console error messages.) Change back to the root directory, unmount the file system, and run fsck(8) on the file system. The bad sectors should show up in two files or in the bad sector files and the free list. Have fsck remove files containing the offending bad sectors, but do not have it remove the BAD/nnnnn files. This operation will leave the bad sectors in only the BAD files. The badsect command works by giving the specified sector numbers in a mknod(2) system call, creating an illegal file whose first block address is the block containing bad sector and whose name is the bad sector number. When fsck discovers the file, it will ask "HOLD BAD BLOCK?" An affirmative response will cause fsck to convert the inode to a regular file containing the bad block. RESTRICTIONS
If more than one of the sectors comprised by a file system fragment are bad, you should specify only one to badsect, as the blocks in the bad sector files cover all the sectors in a file system fragment. ERRORS
The badsect command refuses to attach a block that resides in a critical area or is out of range of the file system. A warning is issued if the block is already in use. SEE ALSO
Commands: fsck(8) badsect(8)
All times are GMT -4. The time now is 06:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy