How it work?? the execlp


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How it work?? the execlp
# 1  
Old 10-23-2010
How it work?? the execlp

int main ()
{ int p=1;
while (p>0)
p=fork();
execlp("prog",prog",Null);
return 0;
}
and thanks Smilie
# 2  
Old 10-23-2010
This User Gave Thanks to jlliagre For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Discussion at work, would a router work pluging a cable in wan1 and lan1?

hi all. and sorry for the random question, but this sparkled a raging flame-war at work and i want more points of view situation a router, with linux of some sort, dhcp client requesting for ip in wan1 (as usual with wan ports) dhcp server listening in lan1, and assigning ip (as usual... (9 Replies)
Discussion started by: broli
9 Replies

2. Programming

Problem with fork() and execlp process

Hello everyone, this is my first post. I have a task to use a fork to create multiple processes and then use execlp to run another program to add 2 numbers. The problem I am having is we are supposed to use the exit() call in the execlp to return the small integer. This is a bad way to... (3 Replies)
Discussion started by: Johnathan_1017
3 Replies

3. Shell Programming and Scripting

My script work on Linux but not work in sunos.

My script work on Linux but not work in sun os. my script. logFiles="sentLog1.log sentLog2.log" intial_time="0 0" logLocation="/usr/local/tomcat/logs/" sleepTime=600 failMessage=":: $(tput bold)Log not update$(tput rmso) = " successMessage="OK" arr=($logFiles)... (7 Replies)
Discussion started by: ooilinlove
7 Replies

4. IP Networking

NIC will not work, but it did work.

I have a client machine that was built and loaded with SCO UNIX 2.1.3, (yes it is old). The machine worked fine on the closed network that I tested on in my shop. I then had to change it to the network that it would be connected to. Below is the host file, router and subnet mask file that I usually... (0 Replies)
Discussion started by: NC user
0 Replies

5. Programming

How use exec, execlp, ....

Hello, I need to do a function in ansi c for linux that work like command cp.I try with this but doesn't work: int copy (char *src, char *dst) { ret = execlp("/bin/cp", "cp", "/home/linux/working", (char*)src,(char*)dst) return 0; } The copy function must do the next "cp origein.txt... (2 Replies)
Discussion started by: NewBe
2 Replies

6. HP-UX

ENOENT error occurs while issueing execlp command

/************************************************************************ * * TEST NAME: setrlimitd_su.c * * PURPOSE: To verify the soft (rlim_cur) and hard (rlim_max) limit * of process RLIMIT_DATA resources correctly inherited by * the exec() system call. * * RESULT: function call should... (1 Reply)
Discussion started by: mansa
1 Replies

7. Programming

execlp to sort

Hi, I have a very small program where I call execlp() to execute sort. Everything works fine. But sort has a -T option which can be used to specify a temporary directory. Now when I use -T with execlp() it does not work. #include <stdio.h> #include <stdlib.h> #include <string.h> #include... (4 Replies)
Discussion started by: the_learner
4 Replies

8. UNIX for Dummies Questions & Answers

cant get this to work

whoami | grep < $1 | echo $1 trying to write a script that finds out who the user is and then takes occurences of that username from a file that is passed as an argument and then displays it (6 Replies)
Discussion started by: iago
6 Replies

9. UNIX for Dummies Questions & Answers

Script doesn't work, but commands inside work

Howdie everyone... I have a shell script RemoveFiles.sh Inside this file, it only has two commands as below: rm -f ../../reportToday/temp/* rm -f ../../report/* My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies

10. Programming

execvp and execlp?

Hi mates, Is there any difference between execvp and execlp? any comment will be appreciated. abdul:) (1 Reply)
Discussion started by: abdul
1 Replies
Login or Register to Ask a Question