The "cat" command is used to view the contents of a file with out opening it.
The cat displays the contents of the file in the same color as that of the terminal. This can be changed and cat can be made to display the text in a different color. This can be done using the command "tput".
We can chnage the terminal font using tput as shown below.
For e.g.
Now we will combine this with cat .
Let us say we have a file temp
temp:
Output:
We can put this in a script and allow the user to pass the number for the color as well as the file to be displayed on the command line.
cat_color:
Save it and give it execute permissions.
Execute it just like the cat command
Output:
To make this script to work like a command we can add the path to the script in the PATH as given in the post Making a script available in all folders
or copy the script into /bin directory.
http://linuxosr.blogspot.in/
ReplyDeleteGoing to graduate school was a positive decision for me. I enjoyed the coursework, the presentations, the fellow students, and the professors. And since my company reimbursed 100% of the tuition, the only cost that I had to pay on my own was for books and supplies. Otherwise, I received a free master’s degree. All that I had to invest was my time. best cat food for older cats with bad teeth
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteWith programmed feline feeders, you can plan your feline's dinners with same time or various.Best Automatic Cat Feeder Wet Food
ReplyDeletePositive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. larger cats
ReplyDeleteNice to read your article! I am looking forward to sharing your adventures and experiences. dog houses for big dogs
ReplyDeleteAiman Online Quran Learning Academy is an impressive online academy for teaching the Quran.
ReplyDeleteThis leading online Quran academy from
Pakistan provides you an excellent chance to have one
to one online Quran classes with tajweed and learn the basic teachings of Islam.
Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. beagle thyroid problems
ReplyDeleteWe have sell some products of different custom boxes.it is very useful and very low price please visits this site thanks and please share this post with your friends. no pull dog harness reviews
ReplyDeleteVery interesting blog. Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one. Just thought that I would post and let you know. cat car carrier
ReplyDeleteExcellent and very exciting site. Love to watch. Keep Rocking. science diet sensitive stomach cat
ReplyDeleteGreat post.
ReplyDeletehttp://groupspaces.com/onlinelearning/pages/8-basic-guidelines-to-become-an-online-tutor
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete