|Syntactic Confectionery Delight|
Re: how to make a run a orogram as sooon as linux is being startedby mwah (Hermit)
|on May 24, 2008 at 13:56 UTC||Need Help??|
(Not exactly a Perl question, but often puzzles unix/linux newbies.)
Two things here. The first one:
how to make a program run as soon as linux is being started
... is usually beeing accomplished by putting the program invocation into the appropriate startup file, most probably (you mentioned "Linux" which one?) the file etc/init.d/boot.local, like mine:
starts the cpu temperature sensors package:
the other question was:
how to make my program run atomatically as as soon as somebody log into the linux system
Same thing here, put the command into the appropriate file, for bash login shell, this might be the file ~/.bashrc in your home directory.
For example, you have a program called 'anonymoushydrogen.pl' in your home directory, which contains the following code:
then, you may put the command:perl ~/anonymoushydrogen.pl
into your .bashrc and all is fine.
But: the exact name of the file may depend on your shell or login configuration (.bashrc, .profile, .bash_profile etc.).