Ok made a little progress. Just messing around, it seems after it runs the process in the background it stops on the line where it is using the fgets function. Everything before this gets printed out...
Type: Posts; User: ashford74
Ok made a little progress. Just messing around, it seems after it runs the process in the background it stops on the line where it is using the fgets function. Everything before this gets printed out...
If I print inside if(id==0) it never gets printed out.
The way it should print out is:
myshell> ls &
hw1.aux hw1.log hw1.tex hw2.dvi hw2.ps hw3.tex
hw1.dvi hw1.ps hw2.aux hw2.log hw2.tex...
C_ntua: If I run it without executing in the background it runs exactly like it should.
tabstop:I think I get what you are saying and might try that.
Ok, sorry for the confusion:
The correct output will have another myshell> prompt like this:
myshell> ls &
myshell> hw1.aux hw1.log hw1.tex hw2.dvi hw2.ps hw3.tex
hw1.dvi hw1.ps hw2.aux hw2.log...
The first one has another myshell> prompt, the bottom one does not, that space there is what I'm getting as output. So a better example for the second one would be:
myshell> ls &
myshell> hw1.aux...
I'm having to write a command interpreter and am stuck on one single part. I can get it to execute, and execute in the background as well. My problem is that when it executes a command in the...