Shell Script Which Gets Executed With Greetings – The Moment User Logs In

in Categories Time and Date last updated April 5, 2008

Write shell script which gets executed the moment user logs in, it should greet user

Script first finds out current hour using date command

Depend upon time of the day, it will say Good morning or Good afternoon to user.

Open your bash / shell startup file i.e. profile file – ~/.bash_profile and put path to this script in file as follow:
/home/you/path/to/script

Sample shell script to greet user