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

3
votes
2answers
159 views

Should stdin or filenames be discarded if both are provided?

grep and sed ignore stdin if you provide a filename parameter: $ echo foo > test.txt $ echo foobar | grep f test.txt foo $ echo foobar | sed -e 's/foo/bar/' test.txt bar Is this established ...
2
votes
1answer
497 views

How redirect input while process is running?

I have an interactive application that takes input from the keyboard. Whenever I run the application I always write the same things in the beginning. So I was thinking I could make a file with those ...
6
votes
2answers
869 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? ...
15
votes
1answer
438 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 ...
1
vote
0answers
160 views

Having problems with script and redirecting input to stdin [closed]

EDIT: found mistake, it was actually bug in my program, I had > instead of >= in my for loop that reads coefficients. I'm fairly new to linux, and I need help with bash scripting. I have C program, ...
9
votes
2answers
251 views

How a piped shell programs balance their output/input rates? [duplicate]

Possible Duplicate: Bash while loop and reading from pipe I come from web programming background, and find myself interested in one peculiarity of using a local shell. I understand that ...
2
votes
3answers
651 views

How to make wc interpret standard in as a file list

I know that there are other ways to go about this, but I'm looking to be able to make wc interpret stdin as a file name or list of file names. For example, ls JP*/std* | wc would work the same as ...
3
votes
2answers
453 views

Piped input to nano

Why does ls | nano - open the editor in Ubuntu but close the editor and save a file to -.save in CentOS? How can I get nano in CentOS to remain open when reading stdin?
5
votes
3answers
593 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 ...
7
votes
3answers
2k views

How do I make python programs behave like proper unix tools?

I have a few Python scripts laying around, and I'm working on rewriting them. I have the same problem with all of them. It's not obvious to me how to write the programs so that they behave like ...
5
votes
1answer
719 views

How to pipe text for a Mutt email body, then edit the email interactively?

I've been trying to figure out how to start Mutt in such a way that it's just like starting up an interactive Mutt and creating a new email, then copying the output of git request-pull into the body ...
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 ...
2
votes
5answers
701 views

Where are command line arguments (e.g. 'some.text') actually passed to?

From what I know, parameters you pass to a command, goes to it's STDIN stream. so this: cut -d. -f2 'some.text' should be perfectly identical to this: echo 'some.text' | cut -d. -f2 as we send ...
23
votes
4answers
4k views

How to do nothing forever in an elegant way?

I have a program which produces useful information on stdout but also reads from stdin. I want to redirect its standard output to a file without providing anything on standard input. So far, so good: ...
8
votes
4answers
4k views

“openssl dgst -sha1” producing an extraneous “(stdin)= ” prefix and trailing newline

If you run this command on your Unix echo -n "foo" | openssl dgst -sha1 You will get this output: (stdin)= 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33 (followed by a newline). How can I force ...
4
votes
1answer
549 views

In a script, check if standard input comes from a file or pipe

I know this has been poorly covered previously, but those answers either lack explanation or don't apply. Basically at some point my scripts needs check if a file is specified, if it was it will be ...
4
votes
2answers
802 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 ...
3
votes
1answer
170 views

How can I pipe a path to pushd?

This seems like it should be easy enough to do, but I'm clearly not understanding something fundamental about piping output back and forth. I'm trying to do something like this: bundle show ...
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, ...
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 ...
1
vote
4answers
323 views

How to make Firefox 9 read stdin?

An earlier question got several nice answers involving stdin, none of which work in Firefox 9.0.1 (Edit: because I didn't read that you had to start a new Firefox process to make them work (thanks ...