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


Share this on:

4 comment

  1. Thank you! this has helped me in a linux net admin lab. The instructor decided not to teach us one bit of this and expected us to do it.

    Thanks,

    Cesar

    Have a question? Post it on our forum!