dspinellis / dgsh

Shell supporting pipelines to and from multiple processes
http://www.spinellis.gr/sw/dgsh/
Other
323 stars 23 forks source link

Problems with recursive invocations #28

Closed dspinellis closed 7 years ago

dspinellis commented 7 years ago

Consider the following command

#!/usr/bin/env dgsh

row()
{
  dgsh -c "dgsh-parallel -n 5 'echo C{}' | paste"
}

matrix()
{
  dgsh -c "/home/dds/libexec/dgsh/dgsh-parallel -n 5 row"
}

export -f row matrix

call matrix | cat
  1. It won't work without the explicit specification of the dgsh-parallel path.
  2. With the absolute path it hangs after outputting the following.
[dds@stereo dgsh]$ example/5x5.sh
▒▒▒▒▒▒▒▒▒7▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒7/home/dds/libexec/dgsh/bash --dgsh --dgsh-negotiate /tmp/dgsh-parallel-14282

I realize that this can be fixed by attaching cat in the matrix statement, but we should somehow error and abort when dgsh commands hanve dangling I/O.

mfragkoulis commented 7 years ago

Fixed in https://github.com/dspinellis/dgsh/commit/fd923aa0e5d28de59833f22d7b91017ac0bef8b2