Hello,

    I gain more knowledge about process controls, jobs and shells I figured it 
would be interesting to throw together my own shell. Just a simple, throw away 
test to help me gain knowledge. 
I was basing a lot of the flow on how bash works however I have hit a problem. 
My code only works when I run it after I am logged in, from a bash prompt :(

I read from stdin, parse then call fork and run the command in execvp(). 

If I set my test shell as the default and try to use it via ssh'ing in or by 
"su - <username> -s /my_test/shell" if fails after the fork. I can read stdin 
and print out. However after the fork the command executed ("ls") seems to be 
unable to access stdin, stdout, stderr and goes into defunct.

Any help or guidance is appreciated, is there somewhere in the source code of 
bash that would point me in the right direction?

Thanks
Michael

Reply via email to