Sponsored Content
Top Forums Programming Calling a shell script from a C program Post 302436077 by swasid on Friday 9th of July 2010 06:36:19 AM
Old 07-09-2010
Calling a shell script from a C program

Hi,

I have a shell script which connects to a database and fetches the count of the records from a table. I want to embed this whole script in a C program. Also the count fetched should be available in the C program for further usage.

Please let me know how this can be done.

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling SHELL script from C program

Hi, I just tried to call a simple script from a pretty simple C program. I could not succeed :-( a message was thrown saying "sh: line 1: "Script name with path": Permission denied" The C program and shell script are below, both are in the same directory and shell script is given... (7 Replies)
Discussion started by: Chanakya.m
7 Replies

2. Shell Programming and Scripting

Calling Functions of Other K Shell Program

Hi, I have a K shell a.ksh function abc { // Some logic } In b.ksh i have included the a.ksh ./a.ksh I want to call the abc function from this b.ksh script. Thanks Vijay (2 Replies)
Discussion started by: vijaykrc
2 Replies

3. Shell Programming and Scripting

calling a program (w/ params) from within shell

Hi all, I need to call some script (s1) from within my shell script (s2). s1 accepts parameters and I want to feed it with values of params from my script. I tried many things but none work (I am so much of a beginner), please help one of my attempts : . . . param1="hehe" param2="haha" ... (12 Replies)
Discussion started by: Lorna
12 Replies

4. Shell Programming and Scripting

calling 'n' number of shell scripts based on dependency in one shell script.

Hello gurus, I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script. i m looking for something like this call 3.1; If 3.1 = "complete" then call 3.2; if 3.2 = ''COMPlete" then call 3.3; else exit The... (1 Reply)
Discussion started by: shashi369
1 Replies

5. Shell Programming and Scripting

Run shell script from C program by calling fork and execl

I need to write a c program that uses the fork and excel system calls to run the shell script mode invoked like this: "./mode 644 ls -l" (that is the argumetns will always be 644 ls -l) here's the mode script: #!/bin/sh octal="$1" shift find . -maxdepth 1 -perm $octal -exec $@ {} \; ... (3 Replies)
Discussion started by: computethis
3 Replies

6. UNIX for Dummies Questions & Answers

Calling a c program using perl script

On bash I run precompiled c Program as follows: ./create_cust 1 10000 US S > us_cust.csv create_cust is a c program and requires 4 parameters. I am redirecting the output of this program to csv file I need to run this same program in perl I am aware of exec command though not... (7 Replies)
Discussion started by: gkbond
7 Replies

7. Shell Programming and Scripting

Calling a shell script from a C program

Hi, I have a shell script which connects to a database and fetches the count of the records from a table. I want to embed this whole script in a C program. Also the count fetched should be available in the C program for further usage. Please let me know how this can be done. Thanks ... (0 Replies)
Discussion started by: swasid
0 Replies

8. Shell Programming and Scripting

Calling perl script in shell program

How to call a perl script in shell program / shell scripting. PLS HELP ME (2 Replies)
Discussion started by: hravisankar
2 Replies

9. Homework & Coursework Questions

Calling compiled C program with Perl program

Long story short: I'm working inside of a Unix SSH under a bash shell. I have to code a C program that generates a random number. Then I have to call the compiled C program with a Perl program to run the C program 20 times and put all the generated random #s into a text file, then print that text... (1 Reply)
Discussion started by: jdkirby
1 Replies

10. Shell Programming and Scripting

How to pass the environment name while calling java program from unix script?

Hi, I'm trying to test one unix shell script in dev environment. But I'm not sure how to pass the environment in my java program calling code. I'm trying to use -DconsumerEnv="DEV" but unfortunately I get 'null' while trying to print the value from java class. System.out.println("Environment: "+... (4 Replies)
Discussion started by: Pramit
4 Replies
gretl(1)							   econometrics 							  gretl(1)

NAME
gretl - GNU Regression, Econometrics and Time-series Library SYNOPSIS
gretl [ options ] [ datafile | scriptfile | sessionfile ] DESCRIPTION
gretl is an econometrics package, built around a shared library which may be accessed using a command-line client program (gretlcli) or a graphical user interface (gretl_x11). The program gretl is a wrapper script that calls the GUI if the DISPLAY environment variable is set, otherwise the command-line client. For details, please start up either the GUI or the command-line client and consult the online help, or read the printed manual, which is available in PDF format via the gretl website, http://gretl.sourceforge.net. OPTIONS
These are the options supported by the gretl_x11 program; gretlcli is a little different. -r script, --run script Open a script. -c, --dump Dump the configuration file. -d database, --db database Open a local database. -e, --english Force use of English. -r script, --run script Open a script. -w database, --webdb database Open a remote database. -h, --help Give help information and exit. -v, --version Give version information and exit. FILES
~/.gretl2rc per-user configuration file ~/.gretl directory for user runtime files ENVIRONMENT VARIABLES
HOME Specifies the user's home directory DISPLAY Specifies the X window display to use SEE ALSO
gretlcli(1) AUTHOR
The gretl team The gretl team 1.9.5 gretl(1)
All times are GMT -4. The time now is 05:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy