The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
2answers
151 views

How process substitution is implemented in bash?

I was researching the other question, when I realized I don't understand what's happening under the hood, what are those /dev/fd/* files and how come child processes can open them.
4
votes
2answers
103 views

Process substitution from curl to bash as root

I'm trying to run a script from URL as root with this command: sudo bash <(curl -s http://copy.com/gLVZIqUubzcS/popcorn) But I'm getting this error: bash: /dev/fd/63: Aucun fichier ou dossier ...
0
votes
0answers
49 views

Gnuplot and process-substitution

I have a log file where I need to cut out two values at different positions. these are: time and dQ in my file. The main problem is the paste I think. cause the other utilities work pretty well on ...
0
votes
2answers
26 views

How can I use tee to print the input stream?

I have a pipe line that looks like this: cat myfile | awk '$3 > 0 { print $1, $2 * $3 }' | tee >(printf) | perl myscript.pl I would like to print the input to my Perl script using tee. How ...
12
votes
2answers
154 views

Output order with process substitution

This is what I usually do to run grep and wc on a file without having to scan it twice <file.txt tee >(grep LITERAL) >(wc -l) >/dev/null However, this yields EXEC LITERAL 32 ...
0
votes
1answer
77 views

Process substitution over ssh with sudo in Bash shell

What is the proper way to do something like this: diff <( ssh -t myuser@hosta 'sudo httpd -M') <(httpd -M) When I want to compare the output of the 2 commands, the first on a remote host the ...
0
votes
1answer
127 views

Occasional error from bash on AIX: Interrupted system call

I am experiencing problems with process substitution in bash on AIX It happens very rarely, apparently only when the server is loaded. An example error message is: line 9: /tmp//sh-np-7841523: ...
4
votes
1answer
153 views

Why doesn't the process substitution <() work with ssh -F

I have some vagrant virtual machines. To log into them I issue the vagrant ssh command. I want to log into them using regular ssh command. The vagrant ssh-config outputs the suitable config file $ ...
2
votes
2answers
175 views

Creating temp file vs process substituion vs variable expansion?

If I am doing something like creating temporary file some process generating output > temp_file cat temp_file process substitution: cat <(some process generating output) another way : ...
1
vote
2answers
126 views

How to run chrome from command line by using process substitution?

I am using the following command without success - $ google-chrome <(grep "simple" SimpleDoc.txt) If I simply do a grep, I get - $ grep "simple" SimpleDoc.txt Very simple doc that contains ...
4
votes
1answer
116 views

Diff the output of the last two commands

I frequently find myself doing something like the following: $ big long command 1 $ big long command 2 $ diff -u <(big long command 1) <(big long command 2) How can I get the shell (bash in ...
0
votes
0answers
71 views

Issues with process substitution

I am quite new to Linux and currently I am using Cygwin on my Windows machine. My problem is I made a script to automate my analytics work and used process substitution in it and it worked fine when ...
2
votes
2answers
265 views

How to open process substituted file from php?

Here's what I tried to do myself: $ type 1.sh #!/bin/bash -eu php -r 'var_dump(file_get_contents($_SERVER["argv"][1]));' -- <(echo 1) $ ./1.sh PHP Warning: file_get_contents(/dev/fd/63): failed ...
5
votes
2answers
163 views

Combining multiple process substitution

Suppose you tried something like this: $ paste ../data/file-{A,B,C}.dat and realize that you want to sort each file (numerically, let's suppose) before pasting. Then, using process substitution, ...
2
votes
1answer
430 views

How to wait for a subprocess used for I/O redirection?

Consider the following snippet of Bash script: exec 3> >(sleep 1; echo "$BASHPID: here") do-something-interesting exec 3>&- wait $! echo "$BASHPID: there" When executed, it produces: ...
7
votes
3answers
236 views

When was process substitution first introduced?

I'm curios to know how long process substitution has been around. What shell first had it? When did it get added to other shells?
3
votes
3answers
1k views

How do I use tee to redirect to grep

I don't have much experience of using tee, so I hope this is not very basic. After viewing one of the answers to this question I came across a strange beheviour with tee. In order for me to output ...
13
votes
1answer
793 views

In zsh, difference between cat <(cat) vs cat | cat vs cat =(cat)?

As a zsh/process substitution noob, I expected cat <(cat) and cat | cat to do the same thing: copy lines from stdin to stdout. My understanding was that both would execute a cat in a subshell, ...
2
votes
1answer
223 views

password problem when feeding a remote file into diff

When I want to compare a local file with a remote file, any of these usually works: $ ssh remote cat file | diff file - $ diff file <(ssh remote cat file) However, sometimes (especially when the ...
5
votes
1answer
361 views

Pipes vs process substitution

While trying the cat "$@" trick to read from either standard input or given files, it turned out that pipe and process substitution handle a missing trailing newline differently: printf %s foo > ...
3
votes
4answers
614 views

Bash Reuse Process Substitution File

I have a big script which takes a file as input and does various stuff with it. Here is a test version: echo "cat: $1" cat $1 echo "grep: $1" grep hello $1 echo "sed: $1" sed 's/hello/world/g' $1 I ...
18
votes
4answers
2k views

Process substitution and pipe

I was wondering how to understand the following: Piping the stdout of a command into the stdin of another is a powerful technique. But, what if you need to pipe the stdout of multiple ...