Questions tagged [stdin]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
20 votes
7 answers
29k views

Clear stdin before reading

I have the following bash script: # do some time consuming task here read -p "Give me some input: " input Now as you might have guessed, if a user presses some random keys during the "time consuming ...
rabin's user avatar
  • 325
11 votes
1 answer
2k views

Read from stdin to new, named, file in vim

I'd like to start vim on a non existing file, named f, with the content c. Both f and c are arbitrary and I'd like to not have to put anything in the vim config to fill new buffers with c. Basically, ...
chelmertz's user avatar
  • 341
4 votes
3 answers
4k views

Supply SU password in a bash script, within the script?

The purpose is to restart the machine if it doesn't get an abort command from the user. The problem is that the way the terminals are set up, user must supply SU password for shutdown, init, reboot, ...
Kendall's user avatar
  • 483
2 votes
1 answer
770 views

Using the same file as stdin and stdout results in empty file

If want to filter a file but if I use the same file as input and output the output file is empty. Is there another solution instead of using a second file? php -r "echo preg_replace('~/\* DEV \*/(.*)/...
Bob's user avatar
  • 23
-1 votes
3 answers
200 views

How to use the command "read" on a Shell script which reads its arguments from stdin

First of all, thank you for your help in advance and sorry in case this was answered before. I have not been able to find it. For helping to understand my question, I have written the following ...
Lucas's user avatar
  • 1
19 votes
4 answers
19k views

Who deals with the star * in echo *

Who deals (interprets) the * in echo * Does the echo see the star or the shell take care about it and return a list of filename .. What about cp temp temp*
faressoft's user avatar
  • 403
15 votes
5 answers
15k views

compare two directory trees

I have two music libraries, one a newer version than the other. I would like to compare them to figure which files I need to copy from new music tree to old. I have tried diff --brief -r /...
curios's user avatar
  • 360