bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How is being invoked via login different?


From: Michael Gale
Subject: How is being invoked via login different?
Date: Tue, 11 Dec 2012 10:04:51 -0800 (PST)
User-agent: G2/1.0

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

[Prev in Thread] Current Thread [Next in Thread]