Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Testing if a file is a terminal?
- X-seq: zsh-users 13592
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "Rocky Bernstein" <rocky.bernstein@xxxxxxxxx>, "Zsh users list" <zsh-users@xxxxxxxxxx>
- Subject: Re: Testing if a file is a terminal?
- Date: Thu, 11 Dec 2008 10:17:21 -0800
- In-reply-to: <6cd6de210812110933i533eb92ei7f603673af235fa5@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <6cd6de210812090847i1d0d76b8wf107e5c8ea2f0f9e@xxxxxxxxxxxxxx> <6cd6de210812110933i533eb92ei7f603673af235fa5@xxxxxxxxxxxxxx>
On Dec 11, 12:33pm, Rocky Bernstein wrote:
} Subject: Re: Testing if a file is a terminal?
}
} David Korn has weighed in on this with respect to ksh.
}
} Here is code along he lines he has suggested (my formatting and other
} small changes which may have introduced bugs):
This is almost exactly what I suggested, except I omitted the
exec {fd}<&-
because you expressed concern about opening and then closing again
the terminal device. In fact, I might even suggest:
if [[ -t $fd ]] ; then
r=0
else
exec {fd}<&-
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author