TIP: Click on subject to list as thread! ANSI
echo: cis.os9.68000.osk
to: All
from: Mike Haaland 72300,1433
date: 1993-07-27 01:53:51
subject: #shell and ex

#: 18453 S12/OS9/68000 (OSK)
    27-Jul-93  01:53:51
Sb: #shell and ex
Fm: Mike Haaland 72300,1433
To: All


I have a real stupid question.  (I thought I knew the answer, but...)

What effect does the ex command have on a shell?  Reason I'm asking is
I've seen alot of fork code like this:

int os9forkc();
extern char **environ;

myfork(command_line)
char  *command_line;
{
  char *args[4];
  int  pid;

  args[0] = "shell";
  args[1] = "ex";
  args[2] = command_line;

  if ((pid = os9exec(os9forkc,args[0],args,environ,0,0,3)) == -1) {
      printf("fork failed\n");
      return(-1);
  } else
      return (wait(pid));
}

I thought that this was actually killing the shell and allowing the command
line to return an error code, but this doesn't seem to be the case.  popen.c
uses code much like this too.  The problem with it is that the os9exec()
never returns -1 unless the shell can't be forked for some reason.  And never
ever depends on the actual command line.

So, what's the real story with ex?

 - Mike -

There is 1 Reply.

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.