LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-17-2004, 08:27 AM   #1
AliDigitaly
Member
 
Registered: Feb 2004
Location: /var/www/html
Distribution: Suse 9.3
Posts: 38

Rep: Reputation: 15
Lightbulb Message of the day


Hi all, as I am new to this forum I'll start with a simple question.

How can I make "message of the day" rotate every day, and how could i add variables to it.

i.e.: When i log into my linux box with ssh/telnet, i get this message:

*Welcome to HAL9000, where everything is running extremely well.

Now i want to add some variables to it:

*Today is $$/$$/$$$$, and the time is $$:$$

*Todays wisdom is: $ (example: Grass can be smoked as well.)

Can that be done?
 
Old 02-17-2004, 07:22 PM   #2
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,111

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
hmm, perhaps you could set up a cron job to pull a random line from say /usr/games/fortune (MESSAGEOFDAYVARIABLE=`/usr/games/fortune`, or a file of yours every day at midnight, or something like that
 
Old 02-17-2004, 08:55 PM   #3
AliDigitaly
Member
 
Registered: Feb 2004
Location: /var/www/html
Distribution: Suse 9.3
Posts: 38

Original Poster
Rep: Reputation: 15
Thanks

I will have skip the time part then ...but no problem.
Got enough clocks anyway.
 
Old 02-18-2004, 08:59 AM   #4
AliDigitaly
Member
 
Registered: Feb 2004
Location: /var/www/html
Distribution: Suse 9.3
Posts: 38

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by AliDigitaly
...but no problem.
I was to positive..

Found out 'fortune' is encoded.
 
Old 02-18-2004, 10:37 AM   #5
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,111

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
try this:
/usr/games/fortune > /etc/motd
as your cron job, that should work
 
Old 02-18-2004, 11:11 AM   #6
AliDigitaly
Member
 
Registered: Feb 2004
Location: /var/www/html
Distribution: Suse 9.3
Posts: 38

Original Poster
Rep: Reputation: 15
ahhaaa /etc/motd is message of the day
Finaly found it.

Hey but what does fortune do then...and why should I use that in this case?
 
Old 02-18-2004, 11:49 AM   #7
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,111

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
fortune is nothing more than an electronic 'fortune cookie', i was simply using it as an example of what you can do...
 
Old 02-18-2004, 11:54 AM   #8
AliDigitaly
Member
 
Registered: Feb 2004
Location: /var/www/html
Distribution: Suse 9.3
Posts: 38

Original Poster
Rep: Reputation: 15
OK, thanks again.

I will use php to do the job, since i have more experience in that.
 
Old 02-18-2004, 04:38 PM   #9
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,111

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
yeah, right, glad to be of service
 
Old 02-18-2004, 06:15 PM   #10
AliDigitaly
Member
 
Registered: Feb 2004
Location: /var/www/html
Distribution: Suse 9.3
Posts: 38

Original Poster
Rep: Reputation: 15
Thumbs up

...really
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What applications do you use day to day? alan_h404 General 11 10-16-2005 08:09 AM
Why not use Astaro as a normal day to day desktop?? chutsu Linux - General 1 10-09-2005 12:42 AM
CommuniGate Pro 30 Day Message Purge chrisk5527 Linux - General 0 08-08-2003 05:29 PM
message of the day im1crazyassmofo Linux - General 2 03-12-2003 12:56 AM
ODD! Cygwin - cat tr outputs email message from ealier in the day?!?!?!?! chingasman Linux - General 0 02-27-2003 06:25 PM


All times are GMT -5. The time now is 11:31 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration