#: 11465 S12/OS9/68000 (OSK)
23-Jul-91 23:27:38
Sb: #11443-#forks and pipes
Fm: Bob van der Poel 76510,2203
To: Bruce MacKenzie 71725,376 (X)
SUCCESS! Thanks Bruce (and everyone else who contributed).
Here's the way to do this dirty business:
1. Set argv[0] to "shell"
2. Set argv[1] to the command plus an 'ex' (eg. ex tr [a-z] [A-Z})
3. Set argv[2] to NULL
This works perfectly. BTW, argv[0]="shell ex" DOES not work. I guess what is
happening is that argv[0] is the name of the program (shell) and argv[1]. This
works fine with the popen() library call:
out_file=popen("ex tr [A-Z] [a-z]","w");
Maybe I'll see if I can hack the popen() thing to automagically stick the 'ex'
in the correct place. On the other hand, I might just do my own parsing for
shell after all . . . it just occurred to me that not all people will be using
SHELL, in which case the call will fail anyways. Have to let this perc a bit.
The help and suggestions I get from all you guys sure is nice. Sometimes I feel
pretty alone up here in the wilderness with no other OS9 folks around, thank
the computer god for CIS!
There are 2 Replies.
|