cat /proc/version usually gives you more information than uname -a. If you use the system builtin to call these commands from perl, remember that it returns true on failure and make sure you use the LIST form or at least avoid shell-metacharacters and shell-pattern-matching-characters in the string that you pass to system.

Here is a shell session on my system:

$ cat /proc/version Linux version 2.6.11.4-21.14-default (geeko@buildhost) (gcc version 3. +3.5 20050117 (prerelease) (SUSE Linux)) #1 Thu Aug 24 09:51:41 UTC 20 +06 $ echo /proc/vers* /proc/version $ cat /proc/vers* Linux version 2.6.11.4-21.14-default (geeko@buildhost) (gcc version 3. +3.5 20050117 (prerelease) (SUSE Linux)) #1 Thu Aug 24 09:51:41 UTC 20 +06 $ uname -a Linux charm 2.6.11.4-21.14-default #1 Thu Aug 24 09:51:41 UTC 2006 i68 +6 i686 i386 GNU/Linux $ perl -e '@args=qw(cat /proc/version); system(@args)' Linux version 2.6.11.4-21.14-default (geeko@buildhost) (gcc version 3. +3.5 20050117 (prerelease) (SUSE Linux)) #1 Thu Aug 24 09:51:41 UTC 20 +06 $ perl -e '@args=qw(cat /proc/vers*); system(@args)' cat: /proc/vers*: No such file or directory $ perl -e '@args=qw(uname -a); system(@args)' Linux charm 2.6.11.4-21.14-default #1 Thu Aug 24 09:51:41 UTC 2006 i68 +6 i686 i386 GNU/Linux $ perl -e '@args=qw(uname -a;echo do-something-evil); system(@args)' uname: invalid option -- ; Try `uname --help' for more information. $ perl -e 'system q(uname -a;echo do-something-evil)' Linux charm 2.6.11.4-21.14-default #1 Thu Aug 24 09:51:41 UTC 2006 i68 +6 i686 i386 GNU/Linux do-something-evil
I think most monks prefer to field non-perl questions in the Chatterbox.

Update: Added <readmore>


In reply to Re: (OT) command for finding out which distribution of Linux is being used by fenLisesi
in thread (OT) command for finding out which distribution of Linux is being used by heidi

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.