Hi
U can use the "system" function, is an ANSI C API, can be used for this
purpose.
>From the C /C++ lang progranm u can call this way: system("ls -l");
This will invoke the Shell ( generally /bin/sh) and gives it . Subsequently
shell runs the command and
returns the exit status of the child process i.e ls -l.
With thanx and regards,
Ramakrishna kvv.
"Yash Dayal" <[EMAIL PROTECTED]> on 07/04/2002 01:11:44 AM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc: (bcc: Veera R Koduri/HSS)
Subject: [ilugd]: how to pass c output to shell??
hello shell script gurus
i have this query,
i want to redirect the output of one c program directly to the shell..
eg:
test.c
void main()
{
cout << "ls -l"
}
I want the output of test.c to be passed to shell ..how do i do that.
one way I found was
./test > tempFile
chmod +x tempFile
./tempFile
is there a direct way to do the above?
Yash
================================================
To subscribe, send email to [EMAIL PROTECTED] with subscribe in subject
header
To unsubscribe, send email to [EMAIL PROTECTED] with unsubscribe in subject
header
Archives are available at http://www.mail-archive.com/ilugd%40wpaa.org
=================================================
================================================
To subscribe, send email to [EMAIL PROTECTED] with subscribe in subject header
To unsubscribe, send email to [EMAIL PROTECTED] with unsubscribe in subject header
Archives are available at http://www.mail-archive.com/ilugd%40wpaa.org
=================================================