capricious
asked on
Unix system calls
Hi,
Wonder if anyone can help me out with this.
Using fork(), execlp() and wait() only, how may I write a function in a C program that simulates the shell AND-list behaviour.
And how may I return the exit status of the last shell command executed from this function?
Any clue?
Thanks in advance.
Wonder if anyone can help me out with this.
Using fork(), execlp() and wait() only, how may I write a function in a C program that simulates the shell AND-list behaviour.
And how may I return the exit status of the last shell command executed from this function?
Any clue?
Thanks in advance.
ASKER
oh, AND-list basically means
$ date && date && ls
and the output prints out the value of 'date', ignoring the rest of the list since date returns 0 as its exit status.
I would like to restrict myself to using the 3 system calls fork(), execlp() and wait() to simulate the AND-list behaviour in a C program. Is this possible?
Thanks for any advice..
$ date && date && ls
and the output prints out the value of 'date', ignoring the rest of the list since date returns 0 as its exit status.
I would like to restrict myself to using the 3 system calls fork(), execlp() and wait() to simulate the AND-list behaviour in a C program. Is this possible?
Thanks for any advice..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I am sorry but I did not get you
BAsically what feature are u talking abt by saying " the shell AND-list behaviour."