* Fergus Wilde; <fwilde@chethams.org.uk> on 01 Jun, 2004 wrote:
On Tuesday 01 June 2004 15:13, Michael Satterwhite wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
SuSE 9.0 KDE
Is there a way to execute a command when a user logs in?
Yes - several ways, I think, and depending on things like their login shell. One way that works in pdksh, for example, is to put
exec [your command] in .profile. In SuSE, they're probably using bash, and you have to figure out what dotfile to use for your particular case, and I can't remember. I recently saw a good summary - the Unofficial FAQ?
http://susefaq.sourceforge.net/howto/bash.html and look for ~/.bash_login also maybe ~/.bash_logout ~/.bash_login doesn't exist by default. You can create it and put custom commands here that you only want to happen once when you first login. If this file exists, then the ~/.profile will not run. Normally, this is not a problem since ~/.profile does not do much and the ~/.bashrc gets sourced from /etc/profile. -- Togan Muftuoglu | Unofficial SuSE FAQ Maintainer | Please reply to the list; http://susefaq.sf.net | Please don't put me in TO/CC. Nisi defectum, haud refiecendum