ksh -t 0-2

ksh -t 0-2

Post by Per Kistle » Wed, 12 Jun 1996 04:00:00



Hi all

What can one actually determine with a ksh quest like that:

if [[ -t 0 ]];then
fi

One could expect, that it tells one, wether the job runs
in the background, if the job is not bound to a terminal for
stdin. But -t 0, -t 1, -t 2 are always true, wether
foreground or background.

Someone knows?

Bye, Per.

 
 
 

ksh -t 0-2

Post by John Verne - CNED/F » Thu, 13 Jun 1996 04:00:00



: Hi all

: What can one actually determine with a ksh quest like that:

: if [[ -t 0 ]];then
: fi

: One could expect, that it tells one, wether the job runs
: in the background, if the job is not bound to a terminal for
: stdin. But -t 0, -t 1, -t 2 are always true, wether
: foreground or background.

: Someone knows?

Heres a guess: [[ -t 0 ]] is described as a way of "testing if the file
descriptor is a terminal"  so it might be a way of testing if that
descriptor has been re-directed, or is a co-routine.

Pretty obscure, no?  My kornshell book refers to this as "arcana".

 --