[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ast-users
Subject:    [ast-users] ksh93s hangs if no /dev/tty
From:       gsf () research ! att ! com (Glenn Fowler)
Date:       2007-10-26 13:50:55
Message-ID: 200710261750.l9QHorqk011138 () penguin ! research ! att ! com
[Download RAW message or body]


I concur that something is wrong with script on cygwin
both pdksh and ksh end up with ? for tty => no controlling tty
bash ends up with a tty (verified by ps ouput)
but I think bash itself must be doing something extra to get it

pdksh notices no controlling tty and then proceeds with
interactive mode, prompts and all, anyway

ksh sees no controlling tty and runs in non-interactive mode
and whatever fd { 0 1 2 } are attached to do not act like a tty

On Tue, 25 Sep 2007 13:34:52 -0400 David Korn wrote:
> > On Wed, 12 Sep 2007 04:50:21 -0700 (PDT) stephan titard wrote:
> > >> hi, I was playing with the script command on cygwin and ksh93[rs] hangs; it c
> > ould be
> > >> a  /dev/tty issue.
> > 
> > >> Playing with the monitor option did not help.  I haven't checked with ksh93s+
> > . Is this 
> > >> already fixed in ksh93s+?
> > 
> > > please provide more details, as in:
> > > "this sequence of commands typed at the ksh prompt fails on cygwin ..."
> > > "this is what I expected using the default xyz shell ..."
> > > thanks
> > 
> > Hi Glenn. Sorry to answer so late. Somehow I missed your post.
> > 
> > Actually the hangup occurs on starting the script command with ksh93; 
> > if I use the
> > other (cygwin) system shells, bash, ash and pdksh, script works fine.
> > 
> > ### here starting script from a "bash" login shell (changing the login shell doe
> > s not seem to 
> > ### make any difference -- it should not but I tried various just in case it mig
> > ht give a clue...)
> > $ steph@ape (~)
> > $ SHELL=/usr/ast-ksh93s/arch/cygwin.i386/bin/ksh93s.exe script
> > Script started, file is typescript
> >                                              [X cursor position]
> > 
> > Terminated
> > 
> > ### need to kill script from other window
> > ### when doing pkill appears the 'Terminated'
> > % steph@ape (/home/stephan) %
> > % myps | tail -n 6
> >    steph    6624       1 con  10:14:47  [/usr/bin/rxvt]
> >    steph    6656    6624   5  10:14:47    [/usr/bin/bash]
> >    steph    6736    6656   5  10:18:47      [/usr/bin/script]
> >    steph    6756    6736   5  10:18:47        [/usr/bin/script]
> >    steph    6768    6756   ?  10:18:47          [/usr/ast-ksh93s/arch/cygwin.i38
> > 6/bin/ksh93s]
> >    steph    7932       1   ?  10:15:35  [/usr/ast-ksh93s/arch/cygwin.i386/bin/ks
> > h93s]
> > 
> > % pkill script  # 
> > 
> > ### using pdksh or bash or ash is OK!
> > ### pdksh warns about job control (trying to disable job control in ksh93s did n
> > ot help)
> > % steph@ape (/home/stephan) %
> > % echo $$  
> > 4268
> > 
> > % steph@ape (/home/stephan) %
> > % SHELL=/bin/pdksh script
> > Script started, file is typescript
> >                                   pdksh: No controlling tty (open /dev/tty: No s
> > uch device or address)
> > pdksh: warning: won't have full job control
> > 
> > % steph@ape (/home/stephan) %
> > % echo $$
> > 7488
> > 
> > ### shell forked by script cmd seems functional...
> > % steph@ape (/home/stephan) %
> > % ls -la aa*
> > -rw-r--r-- 1 steph Ninguno 0 May 31 23:32 aa
> > 
> > 
> > 
> > hth
> > --stephan
> > 

> I don't think that this is a ksh93 problem.  script works on
> all the other systems that I tested including UWIN. 

> Here is the output of ps from uwin

> $ print ${.sh.version}
> Version M 1993-12-28 s+     
> $ script
> Script started, output file is typescript
> $ ps -T
>    PID TT        TIME COMMAND
>      1 ?        1.00s init
> 487169 tty11        0  \_ ksh.exe
> 479360 tty11        0      \_ script.exe
> 506629 tty11        0          \_ script.exe
> 516101 ttyp4        0              \_ ksh.exe
> 436297 ttyp4        0                  \_ ps.exe 

> David Korn
> dgk@research.att.com
> _______________________________________________
> ast-users mailing list
> ast-users@research.att.com
> https://mailman.research.att.com/mailman/listinfo/ast-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic