If you just wanted to display something then "message of the day" aka /etc/motd will do what you want. The contents of /etc/motd are displayed by login(1) after a successful login but just before it executes the login shell.

If you want to execute a program when the system starts there are multiple methods and it depends on the system. On linux just add a line to /etc/rc.local and it will get executed at the end of the startup sequence. One win32 see this for the registry run keys and the startup folder hacks.

To execute something when a user logs on in linux just stick a line in /etc/profile for a global effect or any of ~/.bash_profile ~/bash_login ~/.profile for a per user effect. On win32 it really depends on your setup. See this drag and drool example. For more examples try Google. "linux logon script" "windows logon script" should work well.


In reply to Re: how to run your program when the system is started.... by tachyon-II
in thread how to run your program when the system is started.... by anonymoushydrogen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.