Sample Header Ad - 728x90

Standard input stream redirection

0 votes
1 answer
113 views
stdin: Generally standard input, referred to as stdin, comes from the keyboard. When you type stuff, you're typing it on stdin (a standard input terminal). A standard input device, which is usually the keyboard, but Linux also allows you take standard input from a file. For example:
-shell
cat < myfirstscript
This would tell cat to take input from the file myfirstscript instead of from the keyboard (This is of course the same as: cat myfirstscript). Essentially what this boils down to is that the input for this command (cat) is no longer coming from where it was expecting to come from (the keyboard), but is now coming from a file. I'm confusing something: it was expecting to come from (the keyboard), but is now coming from a file. When you type a file on the keyboard (like: cat myfirstscript) isn't this a file in the same way?
Asked by Guilherme Woolley (1 rep)
Feb 14, 2024, 08:36 PM
Last activity: Feb 23, 2024, 03:58 PM