Following my previous post, I still have one annoying bug that won't leave .
I wrote a simulator for the
bash command under Linux.
When I run my code in a single run, with the these commands:
ls Debug/ | grep r ls >> file.jer & ls & ls & ls & ls >> file.jer ls > file1.rrr ls & ls | grep e ls & ls & ls & ls Debug/ | grep r ls Debug/ > k.out ls Debug/ >> k.out exit
then in the third line
ls >> file.jer the program writes
ls: cannot access : No such file or directory . When I run the program and every run I hit the inputs separately then the correct output is presented. I've tried to debug this so many times, but couldn't find the problem.
Specific problem: when I run the code and hit
ls Debug/ | grep r , the correct output is presented. Following that, when I hit
ls >> file.jer & ls & ls & ls & , also here the code works great. But when I hit
ls >> file.jer , then something very wrong is happening, and I can't seem to find its source , where again the output for the
3rd command is
No such file or directory , but clearly it's wrong, since when I run it in a single run, the file
file.jer is appended with the contents of the current path.
I have a
main, and two
.h files with their two