>> +if tty >/dev/null 2>&1 ; then
>
> Is there any particular reason for calling an external command, instead
> of [[ -t 0 ]] (or [ -t 0 ] if you want to stick to POSIX syntax)?

not really, and recommending -t 0 is probably better, just that so far
people were doing `"$(tty)" = /dev/tty1"`, then those tests expanded from
there (and i forgot -t was a thing)

we could probably mention both, `-t 0` for "any terminal", and
`"$(tty)" = /dev/ttyN` for a specific login

(though note i didn't personaly test [ -t 0 ] yet, but given stdin is
/dev/null, i don't see how any problems would happen over the `tty` check)

-- navi

Attachment: 68990292A7A98C5E.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: PGP signature

Reply via email to