When you are shown that fgrep on some systems has a --color option (as in the fgrep man page excerpt vgersh99 provided), the way to get color output from fgrep would be:
but, you haven't told us what system you're using, so we don't know if fgrep on your system supports the --color option.
Furthermore, many utilities that have color options use the file descriptor associated with the utility's standard output to determine terminal characteristics to determine what escape sequences are needed to produce color on the terminal you're using. If your system's grep family of utilities supports a --color option and uses stdout to determine terminal type, piping the output from fgrep into another utility will disable color output. If your fgrep can't produce color output when stdout is connected to a pipe, you could still translate ASCII soh control characters to spaces using:
but using sed G to produce double spaced output will be more complex:
This User Gave Thanks to Don Cragun For This Post:
hi,
i have text file that file contains below information.
Name,Roll,Mark,Total
Sivasankar,2120,89,410
Raja,2212,87,425
i need to convert text file to CSV file also the heading(Name,Roll,Mark,Total) font should be BOLD and color should be RED. how can i set fonts in csv (5 Replies)
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)
Hello friends - I use various grep commands to search for data in a file. However, to add 'color' seems to not work.
Is there a way to add color to two items that i search? so that i can easily identify in hundreds of lines of output what i am looking for?
zegrep abcdefg... (7 Replies)