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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-17-2004, 07:27 AM
|
#1
|
|
Member
Registered: Feb 2004
Location: /var/www/html
Distribution: Suse 9.3
Posts: 38
Rep:
|
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?
|
|
|
|
02-17-2004, 06:22 PM
|
#2
|
|
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: 2,935
|
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
|
|
|
|
02-17-2004, 07:55 PM
|
#3
|
|
Member
Registered: Feb 2004
Location: /var/www/html
Distribution: Suse 9.3
Posts: 38
Original Poster
Rep:
|
Thanks
I will have skip the time part then ...but no problem.
Got enough clocks anyway.
|
|
|
|
02-18-2004, 07:59 AM
|
#4
|
|
Member
Registered: Feb 2004
Location: /var/www/html
Distribution: Suse 9.3
Posts: 38
Original Poster
Rep:
|
Quote:
Originally posted by AliDigitaly
...but no problem.
|
I was to positive..
Found out 'fortune' is encoded.
|
|
|
|
02-18-2004, 09:37 AM
|
#5
|
|
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: 2,935
|
try this:
/usr/games/fortune > /etc/motd
as your cron job, that should work
|
|
|
|
02-18-2004, 10:11 AM
|
#6
|
|
Member
Registered: Feb 2004
Location: /var/www/html
Distribution: Suse 9.3
Posts: 38
Original Poster
Rep:
|
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?
|
|
|
|
02-18-2004, 10:49 AM
|
#7
|
|
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: 2,935
|
fortune is nothing more than an electronic 'fortune cookie', i was simply using it as an example of what you can do...
|
|
|
|
02-18-2004, 10:54 AM
|
#8
|
|
Member
Registered: Feb 2004
Location: /var/www/html
Distribution: Suse 9.3
Posts: 38
Original Poster
Rep:
|
OK, thanks again.
I will use php to do the job, since i have more experience in that.
|
|
|
|
02-18-2004, 03:38 PM
|
#9
|
|
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: 2,935
|
yeah, right, glad to be of service 
|
|
|
|
02-18-2004, 05:15 PM
|
#10
|
|
Member
Registered: Feb 2004
Location: /var/www/html
Distribution: Suse 9.3
Posts: 38
Original Poster
Rep:
|
...really 
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:45 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|