public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* problem with bash and interactive mode
@ 2002-09-08 15:13 Chris January
  2002-09-08 16:17 ` Randall R Schulz
  0 siblings, 1 reply; 2+ messages in thread
From: Chris January @ 2002-09-08 15:13 UTC (permalink / raw)
  To: Cygwin@Cygwin.Com

I am trying to write a 'su' utility for Cygwin. When I launch bash from my
su command, it defaults to non-interactive mode (as if it's reading from a
script). I have to explicitly add the -i option to force it into interactive
mode. However if  I type 'bash' normally from the command line it runs
interactively.
According to the bash manpage, the criteria for determining whether to run
interactively or not is down to the return value of isatty. I am starting
the process using CreateProcess. I presume this is the same way that, for
example, cmd.exe starts processes. However when I run bash from cmd.exe, it
starts in interactive mode.
Any help or pointers would be appreciated, thanks!

Chris


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: problem with bash and interactive mode
  2002-09-08 15:13 problem with bash and interactive mode Chris January
@ 2002-09-08 16:17 ` Randall R Schulz
  0 siblings, 0 replies; 2+ messages in thread
From: Randall R Schulz @ 2002-09-08 16:17 UTC (permalink / raw)
  To: cygwin

Chris,

Why not use fork() / exec()? That's the POSIX / Unix / Linux / etc. way to 
programmatically initiate a sub-process.

Randall Schulz
Mountain View, CA USA


At 15:11 2002-09-08, you wrote:
>I am trying to write a 'su' utility for Cygwin. When I launch bash from my
>su command, it defaults to non-interactive mode (as if it's reading from a
>script). I have to explicitly add the -i option to force it into interactive
>mode. However if  I type 'bash' normally from the command line it runs
>interactively.
>According to the bash manpage, the criteria for determining whether to run
>interactively or not is down to the return value of isatty. I am starting
>the process using CreateProcess. I presume this is the same way that, for
>example, cmd.exe starts processes. However when I run bash from cmd.exe, it
>starts in interactive mode.
>Any help or pointers would be appreciated, thanks!
>
>Chris


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-08 22:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-08 15:13 problem with bash and interactive mode Chris January
2002-09-08 16:17 ` Randall R Schulz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).