Re: [ -t -a -n "blabla" ]: works in bash 2.03, fails in bash 2.05
From:
Paul Jarc
Subject:
Re: [ -t -a -n "blabla" ]: works in bash 2.03, fails in bash 2.05
Date:
Wed, 08 Oct 2003 11:04:50 -0400
User-agent:
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)
"Reiter, Oliver" <Oliver.Reiter3@Dresdner-Bank.com> wrote:
> The conditional expression [ -t -a <anything true> ], e.g. [ -t -a -n
> "blabla" ],
> should be true when run on a terminal.
See entry E1 in the bash FAQ; the behavior for test with 4 arguments
is unspecified when the first is not "!". Also, the -t operator
requires an argument; without one, it's always true, since it's a
non-empty string. Use this instead:
[ -t 0 ] && [ -n blabla ]
paul