Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: Auto run at boot time



>>>>> "Rafael" == Rafael Coninck Teigao <rafael@example.com> writes:

    >> 3.A command to run when I log-in as a "darren" but not any
    >> other user. Is it possible to differentiate between the first
    >> time I log-in (maybe to backup some files) and each time after
    >> that (I don't want it running a backup if I'm just opening
    >> another virtual console to run man or ls).
    >> 

    Rafael> Just look for you shell rc file (~HOME/.bashrc, for bash

Oops,
It's not gonna work...

man bash
[...]
     Login shells:
       On login (subject to the -noprofile option):
             if /etc/profile exists, source it.

             if ~/.bash_profile exists, source it,
               else if ~/.bash_login exists, source it,
                 else if ~/.profile exists, source it.

       On exit:
             if ~/.bash_logout exists, source it.

     Non-login interactive shells:
     ~~~~~~~~~~~~~~~~~~~~~
       On startup (subject to the -norc and -rcfile options):
             if ~/.bashrc exists, source it.
		~~~~~~~~~
So, it should be ~/.bash_login (if you want it to work only in bash)
or ~/.profile (if you want it to work in ksh, sh etc. as well).

If you'll put this in .bashrc, it will work in _every_ bash, not just
in login shells. 

--
Dmytro


    Rafael> for example) and edit to run your command, it will run
    Rafael> only when you log in.

    Rafael> []'s Rafael

    Rafael> -------------------------------------------------------------------
    Rafael> Next Technical Meeting: February 13 (Sat), 12:30 place:
    Rafael> Temple Univ.  ** presentation: XEmacs, by Steven Baur and
    Rafael> Martin Buchholz Next Nomikai: March 19 (Fri), 19:30 Tengu
    Rafael> TokyoEkiMae 03-3275-3691
    Rafael> -------------------------------------------------------------------
    Rafael> more info: http://tlug.linux.or.jp Sponsor: PHT
-------------------------------------------------------------
Dmytro Kovalev
Tokyo FI UNIX SA, Consultant	
E-mail: dmytro.kovalev@example.com	
--------------------------------------------------------------
-------------------------------------------------------------------
Next Technical Meeting: February 13 (Sat), 12:30 place: Temple Univ.
** presentation: XEmacs, by Steven Baur and Martin Buchholz
Next Nomikai: March 19 (Fri), 19:30   Tengu TokyoEkiMae 03-3275-3691
-------------------------------------------------------------------
more info: http://tlug.linux.or.jp                     Sponsor: PHT


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links