LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-03-2006, 03:21 PM   #1
shamanth
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
coloring the contents of motd file


I want to color the contents of motd file. that should not change the color of the foreground color of terminals and other files.
 
Old 06-03-2006, 05:46 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
I am not sure of motd but for say, /etc/issue you need to 'echo -ne' the ansi escape code into the file, you cannot simply type or c/p it...

So:
Code:
$ echo -ne "\033[" > motd
$ echo -ne "0;34m" >> motd
$ echo "yadda yadda yadda" >> motd
$ echo -ne "\033[" >> motd
$ echo -ne "0m" >> motd
will display "yadda yadda yadda" in blue, then return colors to normal.

See this for more:
http://www.togaware.com/linux/surviv...in_Screen.html

Again though, that is for issue. I am not sure motd will even interpret the escapes...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace contents of a file shiroh_1982 Linux - Newbie 3 05-25-2006 07:50 AM
Deleting Contents of File abdul_zu Linux - Software 3 12-04-2005 02:12 PM
Script to check for contents in a file darin3200 Programming 7 04-25-2004 05:26 PM
Is there any MOTD software available besides /etc/motd? csif Linux - Software 1 04-24-2004 06:36 AM
Delete contents of the file, but not file? mikeshn Linux - General 9 05-28-2003 06:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration