LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-15-2009, 06:32 PM   #1
wtruong
Member
 
Registered: May 2009
Distribution: ubuntu
Posts: 35

Rep: Reputation: 16
Capture exit status from unix command in C


So in C, how do I capture the exit status of a unix command I execute with system().

For example, when I do system("gunzip wahhh.tar.gz");, I want to capture the exit status of gunzip.
 
Old 10-15-2009, 06:50 PM   #2
wtruong
Member
 
Registered: May 2009
Distribution: ubuntu
Posts: 35

Original Poster
Rep: Reputation: 16
http://www.linuxquestions.org/questi...d.php?t=545354

I answered my own question.
 
Old 10-15-2009, 07:44 PM   #3
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
mark this thread as solved
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do I check the exit status of a remote command? Ronayn Linux - General 1 04-25-2009 04:59 AM
error: command 'gcc' failed with exit status 1 yuri16 Linux - Software 1 04-21-2009 01:27 AM
how to check for exit status of a command in one scriptA ,from another scriptB? wrapster Solaris / OpenSolaris 8 07-05-2008 12:12 PM
Exit status of system command?? rmvinodh123 Programming 4 05-04-2007 11:15 AM
Bash command exit status humbletech99 Programming 12 07-06-2006 12:20 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration