1 |
On Thu, May 29, 2003 at 09:31:01AM -0400, John Robinson wrote: |
2 |
> |
3 |
> If I'm not mistaken, LS outputs color input (if it's told to) all the |
4 |
> time, and it is filtered by other programs. Maybe a shell programmer can |
5 |
> comment, 'cause I'm not much of one, but is there a way to ascertain the |
6 |
> context in which a script is run? I didn't think there was one. |
7 |
> |
8 |
|
9 |
you can detect a terminal on a file descriptor with test -t (help test |
10 |
if you use bash) |
11 |
|
12 |
ls uses --color=auto, to show colour only if stdout is a tty, |
13 |
--color=always to show colour no matter what. |
14 |
|
15 |
-- |
16 |
------------------------------------- |
17 |
taviso@××××××××××××.org | finger me for my gpg key. |
18 |
------------------------------------------------------- |
19 |
|
20 |
-- |
21 |
gentoo-dev@g.o mailing list |