helpp!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting helpp!
# 1  
Old 04-07-2005
helpp!

hello
i am new at the UNIX programin thing
and i have this assignment, which would look so easy for many of u
the shell must do the followin thing:

exec parameter < input > output
and another 1
exec parameter < input | exec2 parameter > output

the teacher started it wiz the followin codin:

int main(int argc,char **argv){
pid_t pid; int status,nc;
char *buf; char **args;
buf=(char *)malloc(1024);
while (1){
printf("myShell$");fflush(stdout);
nc=read(0,buf,1024); args=parse(buf);
buf[nc-1]=0;pid=fork();
if(pid==0){
execvp(args[0],args);
printf("execvp failed\n");
}
else {
wait(&status);free(args);
}}}

can any one plzz help me to continue it?
usin simple codin,plz
# 2  
Old 04-07-2005
Read the rules. (6) Do not post classroom or homework problems.
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. Red Hat

Fedora 20 new user and having critical situation !!! Helpp!!!

Hey guys..... Im new user for linux fedora 20.... i really need help ....... i have no idea why suddently when i turn on my laptop fedora turn to be black screen and ask me loging in , when i loging then nothing happen , it stay at the same screen... then i try to go to "with linux secure...,"... (2 Replies)
Discussion started by: asianfootball
2 Replies

2. UNIX for Dummies Questions & Answers

Helpp!!

Hello How to Display the odd/even lines from a file..??? how to display the lines containing a string &2 lines before & 2 lines after..??? Thanksss (3 Replies)
Discussion started by: Reham$
3 Replies
Login or Register to Ask a Question