>>>>> "Binand" == Binand Raj S <[EMAIL PROTECTED]> writes:

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

Even su doesn't work without a terminal.

    Binand> The C code for this kind of check usually reads:

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

Here's a code snippet from ls.c.

      if (isatty (1)) {
                format = many_per_line;
                qmark_funny_chars = 1;
      } else {
                format = one_per_line;
                qmark_funny_chars = 0;
      }


Anoop


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
http://thinkgeek.com/sf
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to