Sponsored Content
Full Discussion: Making a system call
Top Forums Programming Making a system call Post 302078984 by blowtorch on Thursday 6th of July 2006 06:25:21 AM
Old 07-06-2006
reborg is right. Using system will not help if you are going to do it that way.

Understand that system() actually forks and execs whatever command you have given. So your export command would be executed in a child process of the current running process and the environment variables would be set in the child process. When the system() call completes, the child process would end and its environment will not be visible to any further child processes that the main parent process may have. If you want to execute the script through a C program, you have to run it as:
Code:
#include<stdlib.h>
int main() {
   system("full_path_to_script");
}

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Making a SOAP call from within unix shell scripts

Hi guys, Is it possible to make SOAP calls from within Unix shell scripts? I need to access a web service from within UNIX in order to lookup something while I am doing some parsing on a file. Regards, Laud (2 Replies)
Discussion started by: Laud12345
2 Replies

2. Linux

Making Socket System Call From Linux Kernel Module?

Hi Everyone! How can we make a socket() system call from a linux module executing in kernel space? If any one knows, kindly tell me. It will be great. I want to use the socket interface in linux kernel space for sending raw packets over the network. Hamayun (0 Replies)
Discussion started by: mian_m_hamayun
0 Replies

3. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

4. Programming

c system call

How the c compiler differentiates the system calls and function calls? (1 Reply)
Discussion started by: rangaswamy
1 Replies

5. Shell Programming and Scripting

system call

Hi, How to write a system calls in a script ? > cd $HOME > ls -ltr thanks in advance.. (10 Replies)
Discussion started by: hegdeshashi
10 Replies

6. Programming

C:system call

Hi I'm studing the system call. I've written a small program that return the time spent in doing some operations. Now I'd like to write one that return the time spent in user mode of a process. I'm reading that i should use the tms struct: clock_t times(struct tms *buf); struct tms {... (2 Replies)
Discussion started by: Dedalus
2 Replies

7. UNIX for Dummies Questions & Answers

Making tar of a remote file system

Hello, I was asked by my boss to make a backup of one of our systems that is slated to be decommissioned. When I suggested if could tar the "/" directory he nodded and said that would do the trick, When I try and execute the command I get EOF error. I think it is because there is not enough... (2 Replies)
Discussion started by: mojoman
2 Replies

8. Shell Programming and Scripting

system call

Trying to figure out a load issue with a webserver. I have traced a php script and noticed the following connect(4, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("XX.XX.XX.XX")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000035> poll(, 1, 2000) = 1 () <0.000120>... (5 Replies)
Discussion started by: rajan007
5 Replies

9. Solaris

Making HDD backup in sun Solaris system

Hello to all, I have Fujitsu Celzius M470 workstation which has Sun solaris system installed and want to make a complete backup of the hard drive. The existing HDD is SATA II, 500 GB. I don't have much experience working with SUN solaris systems (not at all) but have some experience with... (5 Replies)
Discussion started by: Mick
5 Replies
App::Prove::State::Result::Test(3)			User Contributed Perl Documentation			App::Prove::State::Result::Test(3)

NAME
App::Prove::State::Result::Test - Individual test results. VERSION
Version 3.28 DESCRIPTION
The "prove" command supports a "--state" option that instructs it to store persistent state across runs. This module encapsulates the results for a single test. SYNOPSIS
# Re-run failed tests $ prove --state=failed,save -rbv METHODS
Class Methods "new" Instance Methods "name" The name of the test. Usually a filename. "elapsed" The total elapsed times the test took to run, in seconds from the epoch.. "generation" The number for the "generation" of the test run. The first generation is 1 (one) and subsequent generations are 2, 3, etc. "last_pass_time" The last time the test program passed, in seconds from the epoch. Returns "undef" if the program has never passed. "last_fail_time" The last time the test suite failed, in seconds from the epoch. Returns "undef" if the program has never failed. "mtime" Returns the mtime of the test, in seconds from the epoch. "raw" Returns a hashref of raw test data, suitable for serialization by YAML. "result" Currently, whether or not the test suite passed with no 'problems' (such as TODO passed). "run_time" The total time it took for the test to run, in seconds. If "Time::HiRes" is available, it will have finer granularity. "num_todo" The number of tests with TODO directives. "sequence" The order in which this test was run for the given test suite result. "total_passes" The number of times the test has passed. "total_failures" The number of times the test has failed. "parser" The underlying parser object. This is useful if you need the full information for the test program. perl v5.16.3 2013-05-02 App::Prove::State::Result::Test(3)
All times are GMT -4. The time now is 05:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy