• Fact one this node would be better titled changing a process name under Solaris, but because a previous node with a similar topic used the word "title" I decided to use the same title.
  • Fact two on my mac os x box, the following program changes the title of the process according to ps However, the exact same program run under Solaris does not fool ps.
  • Question one what can I do to get a process listing under Solaris that shows the name of the process as changed by $0
  • Fact three I would have ended the previous sentence with a question mark, but that would look too much like some sort of Perl syntax or the other.
  • Fact four Here is the code in question:
    my $new_name = 'terrences_process'; $0 = $new_name; my $login = getlogin || 'tmbranno'; warn $login; my %ps = ( 'Darwin' => [qw(ps aux)], 'SunOS' => [qw(ps -eaf)] ); my $uname = `uname`; chomp $uname; my $cmd = join ' ', @{$ps{$uname}}, '|', 'grep', $login , '|', 'grep', + $new_nam\ e; warn $cmd; my $ps = `$cmd`; warn $ps;

    In reply to changing title of a process under Solaris by princepawn

    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.