Results 1 to 3 of 3
Can someone advise me on how to make the output of an awk statement a different colour?
My statement is:
Code:
awk -v KEY=/$input/ 'BEGIN { FS = "," } ...
- 11-18-2008 #1Just Joined!
- Join Date
- Oct 2008
- Location
- Edinburgh, Scotland
- Posts
- 18
Colour in awk command
Can someone advise me on how to make the output of an awk statement a different colour?
My statement is:
The statement retrieves data from a csv file, what I want is the value $2 a different colour from Name:Code:awk -v KEY=/$input/ 'BEGIN { FS = "," } KEY { print "Name: " $2 }' data1.csv
Any help would be appreciated
- 11-18-2008 #2Just Joined!
- Join Date
- Oct 2008
- Posts
- 10
In bash:
esc="\033" # if this doesn't work, enter an ESC directly
blue="${esc}[34m"
reset="${esc}[0m"
cat <<EOF
${blue}this is a frase in blue${reset}
EOF
this will work only if your terminal or window supports color ansii sequences
- 11-18-2008 #3Just Joined!
- Join Date
- Oct 2008
- Location
- Edinburgh, Scotland
- Posts
- 18
Thanks very much Creepy,
where exactly do I enter your code i.e. before, after or within my awk command?
Thanks again


Reply With Quote