Hello monks,

I'm playing with a script on Ubuntu that switches my interface configuration between an interface.dynamic file which allows my network card to use DHCP, and an interface.static file which contains a list of virtual interfaces that I use for various networks and devices I connect to frequently.

Running
system('/etc/init.d/networking stop'); system('cp /this/file /to/there'); system('/etc/init.d/networking start');
works like a charm. However, I want to hide the output from /etc/init.d/networking/start from the terminal, and just display my success or failure message. I've tried directing STDOUT to /dev/null, to no avail (and probably not surprisingly). My Cookbook has a recipe for using IPC::Open3, which I think might do what I want once I suss out what I'm doing, but I was wondering if there's another way of doing this that I am missing in my ignorance. The point of this script is, by the by, simply because I can and because it is more fun than the simple shell script I have to accomplish this task already.

My thanks in anticipation of your forthcoming wisdom ;)

Update:
Considering English is my only language, I really shouldn't have to edit out the mistakes I've made after being given a preview.

In reply to Hide program output from terminal by Milamber

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.