PDA

Bekijk de volledige versie : Run script after login ?



ffrr
20-03-2010, 11:14
I want to execute a script after login

I login with root level account

I try to set up a file .bashrc at the follow location


/tmp/local/root/.bashrc

and with the content bellow


cd /opt
date

Does someone know how to do ?

newbiefan
20-03-2010, 12:58
Does someone know how to do ?

http://www.wl500g.info/showthread.php?t=21776

Just add your commands at the end of bashrc
At least you can have for each user an own basrc. Add the home dir of the user to your passwd file and store for each user an own basrc in the homedir.
have fun

ffrr
21-03-2010, 01:45
Thank you for reply,and I try the Tutorial

sorry for my English :P

there is a few question,may I ask ?

1.

after login I need to keyin "bash" by hand everytime to run the content

of ".bashrc" ,Or it doesn't seem to work automatically.


2.

I need to install the 'bash' ,then I could use ".bashrc"

Is there something like "post-boot" , that I could use?

BTW I have try ".shrc" , but it doesn't work :P

al37919
21-03-2010, 07:31
~/.profile θη sourced during login to /bin/sh

you may change your login shell in /etc/passwd