PDA

View Full Version : fortune and /etc/motd


mode
03-26-2002, 03:12 PM
i just downloaded Fortunate v3.0 from http://www.orange-carb.org/~csaldanh/software.html and i did some messing around and made the fortunes come up in the terminal. heres how i did it...

i put the Fortunate.app in the users/home dir
i opened terminal
and i went into /users/*myuser*/Fortunate.app/Contents/Resources/
sudo cp fortune /usr/local/bin/
mv datfiles fortunes
sudo mkdir /usr/local/games
sudo mv fortunes /usr/local/games/

and thats it, when i typed fortune, it gave me a fortune, now my question...
i remeber i friend giving me an account on his computer a few years back, and whenever i loged on, the motd gave me a random quote or fortune. now, what do i do in the /etc/motd file to make /usr/local/bin/fortune run automaticly when i login?

-Mode

hschickel
03-26-2002, 04:30 PM
1. Create the following directory(ies):

~/Library/init/tcsh

2. Create a text file in tcsh called rc.mine:

pico rc.mine

3. Add the paths to the things you want. Mine says:

date
uptime
/sw/bin/fortune

Hugh

ps: As long as you're playing around in ~/Library/init/tcsh you might as well add a couple of other files:

pico path - add the dev tools to your path
set path = ($path /Developer/Tools)

pico environment.mine - make your environment a little more pleasant
set complete = enhance
set noclobber

mode
03-26-2002, 04:38 PM
im using bash as my shell

should i use ~/Library/init/bash
instead?

hschickel
03-26-2002, 04:56 PM
I believe with bash the file to modify/create is ~/.bashrc but you'll need to ask a bashhead. :)

Hugh

WillyT
03-26-2002, 05:04 PM
In /etc create a daily.local with /usr/local games/fortune > /etc/motd You should get a new fortune every day if you machine stays on overnight.
But the motd will only show for each users first login of the day or if they logout and back in.

sao
03-26-2002, 09:36 PM
WillyT,

Or you can also install the package :

'fortune-mod Version 9708-2' (Database of witticisms)


with fink and a new 'fortune' will appear every time you open the terminal.


Cheers...

Titanium Man
03-27-2002, 01:08 AM
If you DID want to use fortune from fink but don't want the witticism every time you open a terminal, you could do the following:

pico thedailypoop.command

in thedailypoop.command (or whatever you call it as long as it ends in .command) write:

#! /bin/sh

/sw/bin/fortune

You can also make that fortune -o for the naughty ones. Next make your new command executable:

chmod 755 thedailypoop.command

Then in the Login pane of your System Prefs, add your new command. This will pop open a term window each time you log in to your machine and present you with a new witticism, if that's what you want :)

Natalie40
04-30-2008, 06:24 AM
I was looking for answers in a similar situation so I'm going to try the advice given here, trying to create some feature for the website and realized that instead of posting a question and waiting for replies I can scan old questions.

Hope it is going to work

hayne
04-30-2008, 12:13 PM
realized that instead of posting a question and waiting for replies I can scan old questions.


Good - but make sure you take note of the date of the postings. Some things have changed in the past 6 years!

Mikey-San
04-30-2008, 01:58 PM
Good - but make sure you take note of the date of the postings. Some things have changed in the past 6 years!

He's spamming a website URL.