invoking an Unix script from a C Program


 
Thread Tools Search this Thread
Top Forums Programming invoking an Unix script from a C Program
# 1  
Old 08-05-2005
invoking an Unix script from a C Program

How to invoke an Unix Script from C program?

(or)

How to invoke another C program from a C program?


thanks
Karthik
# 2  
Old 08-05-2005
you can use system() or exec/spawn function families. check out the man pages for their details.
# 3  
Old 08-05-2005
You can also call popen() / pclose() if you want to be able to have continuing input or get feedback.
# 4  
Old 08-08-2005
Thanks a lot to repliers.

Karthik
# 5  
Old 08-29-2005
reading data

hi
i would like to know ,how i can can read from a file bu using a script
and genrating the content of the file

thanks
# 6  
Old 08-29-2005
Code:
#/bin/ksh
while read record
do
    echo "$record"
done < /path/to/inputfile

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Invoking sql server from UNIX

I would like to invoke a procedure in SQL server which will return some results of a select query from UNIX script. I would like to invoke this procedure and load the data into a flat file in UNIX. Can you please help? I am not able to find any sample programs in Internet. (1 Reply)
Discussion started by: madhu.sushmitha
1 Replies

2. UNIX for Dummies Questions & Answers

invoking script

hi all, is there a way to run a script upon invoking an application . for eg if i click on mozilla i want a script to run , before runniing mozilla , maybe ask a password or something only then open mozilla (2 Replies)
Discussion started by: mithun1!
2 Replies

3. UNIX for Dummies Questions & Answers

Program output in terminal by invoking in cron

Hi, I have lost a lot of hours by looking for answer but without results.. My problem is that: I use Debian GNU/Linux and I want to configure cron in order to run rtorrent every day between 24.00 and 09.00. That part I have achieved, but I couldn't forced cron to make it visible on any of my... (10 Replies)
Discussion started by: juru_piotr
10 Replies

4. UNIX and Linux Applications

Invoking URL from Unix

I want to post an XML message to a http url from my unix shell script. I have already tried using CURL and XDG-OPEN commands but these commands have to be installed separately, which is not possible at my end. Please suggest a way forward. (0 Replies)
Discussion started by: MeghaKhanna
0 Replies

5. Shell Programming and Scripting

Invoking a script

I am new to Unix. Could some tell me what are all the possible ways of invoking/executing a script, doesnt matter which shell you are in. Thanks (4 Replies)
Discussion started by: bobby1015
4 Replies

6. UNIX for Dummies Questions & Answers

invoking non-standard program in linux

I have a program R installed on Ubuntu under /usr/bin/R. I also have a different version installed under /home/user/R. I would like to invoke the locally installed program temporarily. How can I do this automatically by running a script and then switching to the default program? thanks, SM (2 Replies)
Discussion started by: smeme
2 Replies

7. Shell Programming and Scripting

Invoking a program in a loop

In the following script, I wish to invoke a compiled C++ program, consimv4 and pass it some command line arguments through the shell script's command line arguments and variables. But for some reason, when I run the script, I just return to the shell prompt and nothing happens. For the life of me,... (7 Replies)
Discussion started by: msaqib
7 Replies

8. UNIX for Advanced & Expert Users

Invoke unix script using c program

hi i want to invoke a unix script in a C program and also return some value from the script to the C program to use that value further. Basically i am doing a Lookup operation in this unix script and returning the looked up data from a oracle database table.. please help me invoke as well... (1 Reply)
Discussion started by: somi2yoga
1 Replies

9. Shell Programming and Scripting

Invoking one shell script from another unix box

Hello All, I have a shell script A which is in one unix box. Also i have a script B in another unix box. Now i'm struggling to find a way to invoke A shell script from B shell script. Is it possible to do this in any way..Request you anybody please help me in this point. Thanks in advance. (6 Replies)
Discussion started by: RSC1985
6 Replies

10. Shell Programming and Scripting

Invoking Oracle stored procedure in unix shell script

Here's a shell script snippet..... cd $ORACLE_HOME/bin Retval=`sqlplus -s <<eof $TPDB_USER/april@$TPD_DBCONN whenever SQLERROR exit 2 rollback whenever OSERROR exit 3 rollback set serveroutput on set pages 999 var status_desc char(200) var status_code... (1 Reply)
Discussion started by: hidnana
1 Replies
Login or Register to Ask a Question