LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   stdout stdin (https://www.linuxquestions.org/questions/linux-newbie-8/stdout-stdin-352383/)

Furlinastis 08-11-2005 11:27 PM

stdout stdin
 
I'm a little confused if I'm correct or not, I'm thinking this might be painfully obvious :o

If I was to do:

$ ls
file1
file2
file3
dir1
dir2

file* and dir* are stdout, correct?

I'm just a little hazy on what standard input is. Would me typing "ls" be stdin?

Or would this be a better example:

$ dc
2 2 * p
4

Is 2 2 * p stdin? or just 2 2? Or is my thinking way off base?

Matir 08-11-2005 11:39 PM

stdin is basically any typed (or piped) input to a program. For example, the "2 2 * p" is stdin to dc. Commands at the prompt are stdin to bash. Stdout is MOST of what's printed on the screen. There's also stderr, which is where error messages should be printed. Generally, stdout and stderr look the same to users, though they can be separated using output redirection.

Furlinastis 08-11-2005 11:55 PM

ok ... simple enough ... thanks :D

Matir 08-12-2005 12:00 AM

No problem. I hope my explanation cleared things up better than it confused things. :)


All times are GMT -5. The time now is 04:20 PM.