image
image

|


Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old September 18th, 2002, 01:03 PM
usin UNIX since '92
 
Join Date: Oct 2000
Location: Barcelona, Catalonia - Spain
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
dani++ is on a distinguished road
COOL: print random calendar quote on startup!!!

Hi,


shell code snippet, place on '.login' file and enjoy!!!

Quote:
# print a random calendar quote (using today's date)
set n_ = `ls /usr/share/calendar/ | wc -w`
set rand_ = `jot -r 1 1 $n_`
set cal_file = /usr/share/calendar/`ls /usr/share/calendar/ | cat | head -$rand_ | tail -1`
calendar -f $cal_file
unset n_
unset rand_
unset cal_file
Cool! As random engine I use 'jot', but a better engine could be used. Some calendars do not have quotes for all days, so sometimes no quote is shown, you could easily extend it to do a loop until some quote is actually shown.

Dani++
Reply With Quote
Reply

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting a CGI script to work locally on my Mac simX Mac OS X System & Mac Software 11 July 12th, 2002 01:43 PM


All times are GMT -5. The time now is 07:53 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.