Redirected text to be with bold using shell script
I am redirecting some texts to a '.txt' file using shell. Is is possible by any means that, I can make it bold or apply some text color to some particular lines only ?
For example: if my text files contains the following: Header1 Content1 Sub Content1 FootNote1 Here line1 should be bold, line2, 3 and 4 should be in different text colors. I want to do it using shell programming itself... |
By default, such options depend upon the OS and shell you're using. What is your OS?
Read about formatting text in shell script: http://www.java-samples.com/showtuto...utorialid=1383 But I think that such formatting may cause little latency while executing the script, because of such formatting commands in it. |
Quote:
Code:
printf "\e[1;31mContent1\n\033[0m" && printf "\e[1;31mSub Content1\n\033[0m" && printf "\e[1;31mFootNote1\n\033[0m" |
Text files don't permit formatting. Actually you can write down color escape sequences together with the text, but you have to use an application able to interpret them in order to see the colors, the bold text and so on. Example:
Code:
$ echo -e '\e[4;31mThis text is red underlined\e[0m' > file Code:
$ cat file Code:
$ cat -v file |
All times are GMT -5. The time now is 01:36 PM. |