The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
16 views

Pipe string to a command with multiple read prompts

How can I pipe a string to a command with multiple read prompts in OS X? I am running a command for a Parallels VM to enable a password which prompts for multiple values (without running a secondary ...
1
vote
1answer
376 views

shell standard streams redirection order OR 2>&1 1>/dev/null vs 1>/dev/null 2>&1

Can somebody please clarify differences? Is some of those considered as best practice? If I remember correct I somehow on SO read that this 1>/dev/null should precede this: 2>&1 ls -al ...
0
votes
1answer
33 views

zip extractor reading archives from stdin

As follows from UNZIP(1L) man page Archives read from standard input are not yet supported Are there another CLI programs running under Linux/cygwin which can extract from zip archives reading ...
16
votes
8answers
18k views

How to write a script that accepts input from a file or from stdin?

How can one write a script that accept input from either a filename argument or from stdin? for instance, you could use less this way. one can execute less filename and equivalently cat filename | ...
1
vote
0answers
19 views

Ghostscript — Stay In Interactive Mode

When I pipe postscript data into the gs program, gs interprets the data and then immediately exits. This matches the man page: - This is not really a switch, but indicates to Ghostscript ...
-1
votes
1answer
42 views

How to pass STDIN to wall in OS X?

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/wall.1.html The OS X man page seems to be almost identical to the Linux one, at least at the beginning, wherein it ...
11
votes
4answers
1k 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*
1
vote
5answers
2k views

Bash/csh: test for end of file (EOF) of stdin

I would like to do: if not eof(stdin): pass stdin to program else: do nothing I have a feeling that it can be written fairly close to: if test ! --is-eof - ; then exec program The ...
3
votes
1answer
323 views

Run command for every line of a file in bash, passing lines as standard input

How do I pass some input to a command line by line (ie. invoke the command for every line)? xargs does not work because it passes the lines as arguments, not as standard input. The specific case ...
1
vote
1answer
38 views

Head waits for full stdin before printing

When one runs ls | head head seems to wait for the full output of the piped command before printing to screen. This is undesirable when the command will take a very long time to run, such as when ...
4
votes
3answers
2k 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, ...
1
vote
3answers
179 views

Can the contents of /dev/disk0 (/dev/sda, etc) be used as stdin?

I'm learning about the /dev filesystem. I've begun with /dev/sd* (Linux) and /dev/disk* (OS X), and I've found some interesting behaviour. If I run: $ sudo xxd -l 1024 /dev/disk0 I get the ...
0
votes
0answers
29 views

How to make this elisp work? Send STDIN to EMACS

Sending stdin to emacs list this doesn't work: $ ~jsmith/bin/some_script some_arg | emacs -nw I found this elisp code at an older superuser post: # An emacs 'alias' with the ability to read from ...
0
votes
2answers
645 views

Using a file input as stdin for a shell script does not work

I have the following script code: test.sh echo "BEGIN" while read CMD <&1; do [ -z "$CMD" ] && continue case "$CMD" in start) echo "get_start" ;; ...
0
votes
0answers
13 views

How to get stdout of another program [duplicate]

Some Linux program prog1 permanently prints to console. I'd like to read and analyse it's stdout in my C program prog2 as stdin. I can't change prog1 source. I expect something like this command: ...
1
vote
2answers
443 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 ...
8
votes
6answers
6k 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 ...
4
votes
3answers
3k views

Windows how to redirect file parameter to stdout? (Windows equivalent of `/dev/stdout`)

Windows console: Tool A can write binary data to a file, but has no option for telling it to use stdout. Tool B can read binary data from stdin and process the info in it. How can I get the output ...
2
votes
1answer
266 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 ...
0
votes
0answers
177 views

How can I get RAR to create a segmented archive (volumes) when compressing from stdin?

I have this ZFS box where I'm creating incremental snapshots, then piping them into RAR (4.2) for compression and encryption, and finally backing those files up remotely. Thing is, RAR seems to ...
0
votes
1answer
641 views

Type an EOF without a line break

I have a little command that I use to copy/paste files around that involves pasting the base64-encoded tar archive into stdin, but the base64 utility keeps giving me and error message about my input ...
1
vote
1answer
51 views

How is standard input displayed on a terminal?

According to the Wikipedia article on standard streams, The keyboard is connected to a program via standard input. I'm assuming the program refers to a shell, which interprets the commands inputted by ...
1
vote
0answers
85 views

how to simulate a file under linux?

I'm basically trying to do this using openssh: I have a private key, however it isn't in file (it's in memory). Now, I want to create the public key in openssh format. For that I would generally run ...
1
vote
1answer
291 views

Why the here-strings in bash are slower than piping the input to a command?

I compared the execution time for unix here-strings and pipe data input to bc: pipe time for i in {1..1000} do echo "sqrt(5.09)" | bc -q > /dev/null done real 0m3.584s user ...
2
votes
1answer
1k views

“stdin: is not a tty” message from scp

I got this message when I copy file using scp to CentOS server "stdin: is not a tty". What it means and how I make it go away? The transfer is ok.
1
vote
1answer
495 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, ...
0
votes
1answer
464 views

Is it possible in ffmpeg to seek to position of the file that is received through stdin

Is it possible to -ss in ffmpeg to the file, that is being received via pipe? So that I start reading it from a given timecode? I am not encoding the file. Thanks
0
votes
1answer
705 views

When I run a program over ssh, why does stdin stop echoing back?

When I run a particular program on my server using putty and I hit ctrl+c to stop it, my stdin stops echoing back to me at the command line. So for example, after running the program and stopping it, ...
0
votes
1answer
33 views

Piping results back into the program that generates them

I've got a program that can take input from stdin and produces output in the stdout like this: cat initial_input.txt | myprogram myindex myoptions - | filter_output > outfile.txt The program ...
0
votes
1answer
44 views

Launching a program and retrieving its standard streams later

I want to be able to start some specific servers (related to a game) on a my VPS (to which I connect through ssh). This is simple, I just connect and execute the command, but this creates some ...
3
votes
1answer
682 views

Getting back to “stdin” after redirecting a file to a particular program

I need to achieve a particular effect using bash's redirection facilities. I know that I can redirect a file to some program's standard input: [user@host]$ application < file.txt The thing is, ...
10
votes
2answers
7k views

Indicating end of Standard Input

How does one indicate that one has finished entering test in stdin? For example, let's say that I wish to encrypt 'blue' using MD5 (I know MD5 is unsecure, but just for this example). I tried user$ ...