Is it possible to simulate process substitution on msys / mingw (using bash 3.x)

I am trying to use process overriding to avoid using temporary files. I tried the following:

diff <(echo "a") <(echo "b")

on mingw32 / msys (from http://www.mingw.org/ as of December 2013) and received:

sh: syntax error near unexpected token `('

Running the same thing on Ubuntu 12.04 returns:

1c1
< a
---
> b

In msys, I am probably using bash 3.1. I was wondering if it was possible to work around the problem so that the same work would be done in msys / old bash without using temporary files.

Thank.

+2
source share
1 answer

bash 3.x. . bash. , somiting :

/bin/bash diff <(echo "a") <(echo "b")

POSIX . :

set +o posix

. .

. GNU bash 4.1.2 (1):

diff - p <<< "test" & echo "test2" > p

.

+2

Source: https://habr.com/ru/post/1650354/


All Articles