Find the answer to your Linux question:
Results 1 to 4 of 4
hi friends, i am trying to run a bash script at the time of a login of any user . i have made an entry in the .bashrc . i ...
  1. #1
    Just Joined!
    Join Date
    Jan 2008
    Posts
    20

    Smile running a bash script on login

    hi friends,
    i am trying to run a bash script at the time of a login of any user .

    i have made an entry in the .bashrc .
    i have also tried making an enty in .bash_profile ,

    The scripts only executes whenever the root logs in ..
    Not when the other user logg in ,

    Is there a file that is executed at the time of execution of any user.


    thanks in advance,
    anshul.

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Did you write it in the root's .bash_rc? Then it's only for root.

    You need to write it in /etc/bash.bashrc or /etc/profile in order to have it executed for all users.

  3. #3
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    In addition, check the man page of bash for a complete list of rc files, and in which order they are read.

    As GNU-Fan already said, *everything* under a given $HOME directory is specific to that user and no one else, and /root/ is the $HOME for the "root" user.

  4. #4
    Just Joined!
    Join Date
    Jan 2008
    Posts
    20

    Talking

    thankyou friends,

    that was exactly what i was looking for...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...