Solved

exit code of a command executed by rexec

Posted on 1999-01-27
1
226 Views
Last Modified: 2013-12-26
I'm executing a command on SCO Open SERVER 5 with the following call:
soc = rexec(&hoststr, (u_short)service_entry->s_port, user, passwd, cmd, &fd2p);
I can read the stdout of the command from the socket soc, and I can read the stderr of the command from the socket fd2p.
How can I get the exit code of the command?
0
Comment
Question by:wiggershaus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
mliberi earned 200 total points
ID: 1296412
The only way is to get it from stdout or stderr.

Instead of running "cmd", run the command "sh -c 'cmd;echo $?'" or "sh -c 'cmd;echo $?'>&2" and get the rc from the last line of stdout or stderr respectively.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 146
Generic progress indicator 6 121
countEvens challenge 2 117
canBalance challenge 34 111
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question