bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

test -t FD vs. [FD]


From: Dan Jacobson
Subject: test -t FD vs. [FD]
Date: Thu, 19 Jun 2003 04:47:44 +0800
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

[remove emacs group when following up]

>> Why does (shell-command "test -t&&tty") get so far to tell me 'not a
>> tty'!?

Paul> With a single argument, test only tells you whether that arguments is
Paul> empty.  You want "test -t 0" (or 1 or 2).

$ man test
       -t [FD]
              file descriptor FD (stdout by default) is opened on a terminal
I.e. argument optional

$ help test
        -t FD          True if FD is opened on a terminal.
Not so optional with bash then.

You guys should unify them.
>> Wait, (shell-command "/usr/bin/test -t&&tty") doesn't get that
>> far, good.

Paul> Looks like /usr/bin/test is buggy.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]