Is default standard input the keyboard or the terminal?

Is default standard input the keyboard or the terminal?

Post by RolandR » Tue, 06 Dec 2005 20:08:49



Is default standard input the keyboard or the terminal or something
else?
 
 
 

Is default standard input the keyboard or the terminal?

Post by Kenny McCorma » Tue, 06 Dec 2005 20:58:53




>Is default standard input the keyboard or the terminal or something
>else?

Yes.

 
 
 

Is default standard input the keyboard or the terminal?

Post by RolandR » Tue, 06 Dec 2005 21:22:07





> >Is default standard input the keyboard or the terminal or something
> >else?

> Yes.

Such wisdom!
 
 
 

Is default standard input the keyboard or the terminal?

Post by Janis Papanagno » Tue, 06 Dec 2005 23:08:40






>>>Is default standard input the keyboard or the terminal or something
>>>else?

>>Yes.

> Such wisdom!

My answer to your vague question would probably also not have satisfied
you; it were: "It depends." Question: What "keyboard or terminal" would
a process initiated by a cronjob have? If you would be more verbose what
the motivation of your question is, or give a specific szenario, you'll
likely get answers that are more helpful to you, I guess.

Janis

 
 
 

Is default standard input the keyboard or the terminal?

Post by RolandR » Tue, 06 Dec 2005 23:48:40







> >>>Is default standard input the keyboard or the terminal or something
> >>>else?

> >>Yes.

> > Such wisdom!

> My answer to your vague question would probably also not have satisfied
> you; it were: "It depends." Question: What "keyboard or terminal" would
> a process initiated by a cronjob have? If you would be more verbose what
> the motivation of your question is, or give a specific szenario, you'll
> likely get answers that are more helpful to you, I guess.

I know that standard output goes to the terminal by default as does
standard error but I am not sure that standard input is picked up
directly from the keyboard or from a terminal buffer in which case
standard input could be said to be the terminal. I am just being fussy.
I have to write a guide so I like to be precise where possible.
 
 
 

Is default standard input the keyboard or the terminal?

Post by matt_left_coas » Wed, 07 Dec 2005 00:23:40



> I know that standard output goes to the terminal by default as does
> standard error

Really? That's news to me. What terminal does standard out and standard
error of a cron job go to? A cron job is not associated with a terminal.
There is NO TERMINAL FOR standard in to come from or standard out to go to.

--

 
 
 

Is default standard input the keyboard or the terminal?

Post by Keith Thompso » Wed, 07 Dec 2005 06:54:08




[...]
>> My answer to your vague question would probably also not have satisfied
>> you; it were: "It depends." Question: What "keyboard or terminal" would
>> a process initiated by a cronjob have? If you would be more verbose what
>> the motivation of your question is, or give a specific szenario, you'll
>> likely get answers that are more helpful to you, I guess.

> I know that standard output goes to the terminal by default as does
> standard error but I am not sure that standard input is picked up
> directly from the keyboard or from a terminal buffer in which case
> standard input could be said to be the terminal. I am just being fussy.
> I have to write a guide so I like to be precise where possible.

The initial stdin, stdout, and stderr for any process are determined
by the process that invoked it.  They're going to be the same as those
of the parent process unless the parent process does something to
change them.

For a program executed from an interactive shell, all three are likely
to be the terminal -- unless you redirect one or more of them on the
command line.

I'm not sure what distinction you're making between a "terminal" and a
"keyboard".  For an old-fashioned physical terminal like a VT100, the
keyboard is part of the terminal.  Input may be buffered, of course.

--

San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.

 
 
 

Is default standard input the keyboard or the terminal?

Post by Kenny McCorma » Wed, 07 Dec 2005 08:41:22




...

Quote:>The initial stdin, stdout, and stderr for any process are determined
>by the process that invoked it.  They're going to be the same as those
>of the parent process unless the parent process does something to
>change them.

Actually, I don't think it is possible for a process to change the
file descriptors (i.e., change what they point to) of another process
(other than by system-specific hacks, such as using the /proc file system
and/or other "debugging" hooks).
 
 
 

Is default standard input the keyboard or the terminal?

Post by Keith Thompso » Wed, 07 Dec 2005 15:11:47





> ...
>>The initial stdin, stdout, and stderr for any process are determined
>>by the process that invoked it.  They're going to be the same as those
>>of the parent process unless the parent process does something to
>>change them.

> Actually, I don't think it is possible for a process to change the
> file descriptors (i.e., change what they point to) of another process
> (other than by system-specific hacks, such as using the /proc file system
> and/or other "debugging" hooks).

I meant that the parent process can change the descriptors for the
child when it creates it (between the fork() and the exec()), not
after the child is already running.  For example, a shell does this
when it processes a line like

    some_command <infile >outfile 2>errfile

--

San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.

 
 
 

1. Getting External Terminal to Work With Standard Keyboard

This, I believe, is an unusual problem.

I have an old WYSE terminal that I wish to use as the console display
for a Linux box.  The problem is that this terminal has no keyboard.
So I want to know: how can I get the Linux kernel to use the external
terminal with the standard PC keyboard as the console?  (Note that I'm
doing this because I don't have any extra monitors lying around.  And I
have tested that the terminal works. :-) )

I am perfectly willing to hack the kernel to do this.  The solution I
see is to build a virtual character device driver--something like the md
device for software RAID--which uses the input from one (normal)
character device, and the output from another.  I believe this would
also solve some other problems, like multi-heading with multiple USB
keyboards.

However, if there's an easier way already there, that would be good,
too.  I just haven't heard of one.

I suppose it would also be useful to provide some way to open any
program as a virtual character device (i.e., write() ops are fed to
stdin, read() ops are read from stdout).  But that may be beyond my
current abilities.

Anyway, I may be completely out there.  I don't have any actual kernel
hacking experience, and pointers would be appreciated.

--
                                         Ben Olmstead/BEM

2. netboot with NE2000

3. standard input instead of input file

4. IPC-Questions (Sun SPARC)

5. Merging keyboard input with serial console input?

6. vi editor FAQ (Frequently Asked Question List), Part 2/2

7. How does keyboard input transmit from keyboard of X Server to application?

8. Just installed Debian Linux. Need help with drives, and installing X Windows.

9. LCSDNYR 2001 -> standards, standards, standards

10. FAQ Requested: Help I am Being Scanned on Non-Standard Ports

11. standard input to read

12. standard input to rmdir?

13. DOSEMU: dosemu needs a standard input