stdin is the name of the default input file descriptor of a process. Since there is really nothing special about `stdin`, you *should not* use this tag. Use [tag:io-redirection] for questions on how to redirect input, use [tag:file-descriptors] for questions on how to manage file descriptors, use ...

learn more… | top users | synonyms

5
votes
3answers
589 views

Construct a command by putting a string into a tty

I managed to do this echo -n "command" > /dev/tty1 The letters appear, and the cursor moves, but they are "ghosts" - if you hit enter, nothing happens (they are not in stdin). Edit: In the ...
4
votes
2answers
796 views

Can I read and write to the same file in Linux without overwriting it? [duplicate]

Possible Duplicate: How can I make iconv replace the input file with the converted output? I frequently connect to amazon ec2 using their public DNS names ...
6
votes
2answers
3k views

what is meant by connecting STDOUT and STDIN?

This is a newbie question. I'm reading a book, it says: Every process has at least three communication channels available to it: “standard input” (STDIN), “standard output” (STDOUT), and ...
28
votes
4answers
8k views

Can I pipe stdout on one server to stdin on another server?

stdout on one CentOS server needs to be piped to stdin on another CentOS server. Is this possible? Update ScottPack, MikeyB and jofel all have valid answers. I awarded the answer to Scott because, ...
15
votes
1answer
435 views

Make program first read from pipe, then from keyboard

Consider the interactive program interactive. I have to run this program fairly frequently, and each time I run it the first few commands are the same. Obviously, having to type those commands over ...
3
votes
1answer
5k views

nohup: ignoring input and redirecting stderr to stdout

I am starting my application in the background using nohup as mentioned below - root@phx5qa01c:/bezook# nohup java -jar ./exhibitor-1.5.1/lib/exhibitor-1.5.1-jar-with-dependencies.jar -c file ...
3
votes
3answers
2k views

Bash script that reads filenames from a pipe or from command line args?

I want my script to read a bunch of filenames (which may have spaces) given either as a glob or from STDIN and do stuff with them. I've been able to read either way separately, but not combine them. ...
7
votes
3answers
757 views

Why do some commands not read from their standard input?

I wonder what when we should use pipeline and when we shouldn't. Say for instance, to kill certain process which handling pdf files, the following will not work by using pipeline: ps aux | grep pdf ...
5
votes
2answers
1k views

linux stdbuf - line-buffered stdin option does not exist

The man page for the stdbuf command states that line-buffered mode is invalid as a standard input buffering option. What is the reason for this? tail -f access.log | stdbuf -iL cut -d' ' -f1 | uniq ...
1
vote
1answer
48 views

Is bluetooth keyboard associated with `stdin`?

I know that keyboard is standard input and is referred by the stdin file. I sometimes use a Bluetooth(BT) keyboard when working on my laptop. Both keyboards, my laptop keyboard as well as the BT ...
6
votes
2answers
860 views

Pipe Password to Application When Asked

The following should be done in a bash script: curl --digest --user schmijos https://bitbucket.org/u/p/get/tip.zip -o tip.zip How can I automatically submit a password to curl when it asks for it? ...
4
votes
1answer
149 views

Piping commands, modify stdin write to stdout

echo Hello World | nano - | less I want to modify Hello -> Goodbye while in the the text editor. It does not have to be with nano. I am stuck with nano reading stdin but requiring me to write to a ...
3
votes
5answers
862 views

How to use filename arguments or default to stdin, stdout (brief)

I want to handle filenames as arguments in a bash script in a cleaner, more flexible way, taking 0, 1, or 2 arguments for input and output filenames. when args = 0, read from stdin, write to stdout ...
2
votes
3answers
110 views

How can a command have more than one output?

In this answer, at the very bottom, Gilles mentions that a command can have more than one output or input. Yes, there's cat foo bar | something, for having both foo and bar as inputs, and there's tee ...