execvp()

execvp()

Post by che » Thu, 26 Sep 2002 00:07:15



The code below will read in a file of commands that might look
something like this and fork child processes executing them.  Let's
say we have a file named batch that looks like this:
ls -l
ps
some_executable

the programming would be run with the following command.
./a.out 2 <batch

When I execute this program it will fork() the executable name
"some_executable" in this case but when it tries to fork the ls or ps
I get "ls command not found".  I have my $PATH set /bin.  Does anyone
know why it can't find ls?  Am I doing the execv wrong?
thanks

 
 
 

execvp()

Post by Barry Margoli » Thu, 26 Sep 2002 00:11:13




>The code below will read in a file of commands that might look
>something like this and fork child processes executing them.

You forgot to include "the code below".

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

1. execve(2) and execvp(3)

Greetings,

I seem to recall under one of the exec functions, under some version of
one of the unixes,
that you could specify the name of the program in one part of the arg
list, and the NAME
that you wanted to use for the executing process.

Can someone either:

a) give an example, if this was true
b) point me to the OS that DOES have this feature, if it's not widely
used (i.e.
        only one vendor did it this way)
c) tell me I just misremembered this

Thanks

2. RH Linux to Windows family networking problem

3. execvp: error

4. ap info displayed durring setup

5. SSHD (execvp) fails to start due to unable to read file -- /etc/rc.d/init.dfunctions

6. Linux as an Internet provider box...

7. execvp errors?

8. How to get my FAT32 partitions back?

9. execvp() behavior help!

10. Starting portmapper: execvp: Permission denied

11. About execvp

12. Redirecting stdio and stderr when using execvp

13. make: execvp: ld: Permission denied