execute shell script at login
I want to execute a shell script whenever i login to my account.
The shell script should show the date and username in the terminal.
how to do this???
please help me
I want to execute a shell script whenever i login to my account.
The shell script should show the date and username in the terminal.
how to do this???
please help me
Hi: If that's all you need you can simply add a line to your .bash_profile
echo -e "The date = "$(date)"\nThe user = "$(id)
or
echo -e "The date = "`date`"\nThe user = "`id`
Assuming you're using bash as default interpreter.
Kind regards
Alternatively you could create a bash-script and start it at logon with Startup Applications Preferences
. You can start this GUI tool with the following command.
gnome-session-properties
The content of the bash-script could be something like this.
#!/bin/bash
# print date
date
# print name
whoami
# wait for input
read
Don't forget to make the script executable!
chmod 755 /somewhere/script.sh
Asked: 2013-11-03 08:54:47 -0600
Seen: 6,669 times
Last updated: Nov 03 '13
[Solved] Weird error running working shell script from cron
Utility to show command line arguments?
Is Fedora 23 Nautilus-actions obsolete?
how to check if system is rpm or debian based
Create an icon in activities tab.
generate a fixed sequence for a given seed
Error importing function definitions in Bash