Hi Ryan,
You could try the Unix shell compiler at
http://www.datsi.fi.upm.es/~frosal/ which doesn't actually compile the
shell script but generates C and then the standard C compiler does the
rest. maybe write in shell with mv's and compile to C and see if it
looks efficient?
hope this helps
]
10/22/2003 08:59 PM
Please respond to ORACLE-L
To:Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
cc:
Subject:Re: OT: How to call unix shell scripts from 'C'?
the basics are they i want 'C' so i can use a file pointer. I need to do
some search and replace
If you want the C program and the spawned shell script to
interact and communicate back and forth with each other,
then you'd have to use the pipe() system call to set up a
two-way interprocess-communication pipe in the C program,
then call fork() to spawn a new identical process
(including the
fork() and exec() are what you're looking for. I haven't done it in a
while, but you should be able to find plenty of info online.
On Wed, 2003-10-22 at 11:44, [EMAIL PROTECTED] wrote:
The unix and C forums are pretty inactive. Hope its ok to ask this here.
Anyone know how to do this?
Title: RE: OT: How to call unix shell scripts from 'C'?
If it is just a simple script call use system(/home/me/myscript);
Be careful, your env vars might not be what you expect them to be.
-Original Message-
From: Quintin, Richard [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October
Quintin, Richard wrote:
fork() and exec() are what you're looking for. I haven't done it in a
while, but you should be able to find plenty of info online.
On Wed, 2003-10-22 at 11:44, [EMAIL PROTECTED] wrote:
The unix and C forums are pretty inactive. Hope its ok to ask this here.
the basics are they i want 'C' so i can use a file pointer. I need to do
some search and replace in a group of files. If I use straight scripting I
have to redirect the output to a new file and do a 'mv' to rename it back.
with the filepointer, I was hoping to be to use fopen in C to open the