By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,693 Members | 1,972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,693 IT Pros & Developers. It's quick & easy.

Unix command, hide error message

P: 11
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


Dec 5 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 2.5K+
P: 3,503
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.


Dec 6 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.