On Tuesday 02 July 2002 12:12 pm, Linux Rockz wrote:
> My point is, I have seen that happen to 'ls' and I like what I see there.
> However, the (perhaps) natural assumption that output will be in the
> same format regardless of the output device has been shaken.
>
> Are there any other anomalies like 'ls' that I should be watching out
> for?

Well, gzip, bzip2 etc. check the output device and refuse to write compressed
output to terminals, unless specific options to force this behaviour is given.

A variety of programs that require a password refuse to read the password from
any device except terminals, usually resulting in queries here like "I tried
echo password | ssh -l username somehost somecommand, in a script, but it
didn't work". ;-)

The C code for this kind of check usually reads:

if (isatty (fileno (stdout))) {
   printf ("STDOUT is a terminal\n");
   /* Rest */
} else {
   printf ("STDOUT is not a terminal\n");
   /* Rest */
}

Binand



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to