Unix command, hide error message

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KiSSFRo
    New Member
    • Sep 2008
    • 11

    Unix command, hide error message

    Hi all,

    I was wondering if someone could tell me which is the best command to use to run a unix command and to hide the error output from the shell. I'd also like to be able to tell if the command failed or not. What would be the best to use: backticks, system or exec?

    BTW I also cross posted this over here: Perl Guru Forums: Perl Programming Help: Beginner: Unix command, hide error message



    Thanks,

    KiSSY
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Thanks for letting us know that you cross posted. That is always good to know.

    You want to use the system() function as it returns a code for failure/success. Also, the link will show you how to use it with the die function for failure.

    Regards,

    Jeff

    Comment

    Working...