dspinellis / dgsh

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

Fail to run simple script #5

Closed dspinellis closed 7 years ago

dspinellis commented 7 years ago

Running sgsh on a file with the following produces no output.

{{
        echo hi &
        echo there &
}} | {{
        sed s/^/a/ &
        sed s/^/b/ &
}}

Same with

sgsh -c '{{ echo hi & echo there & }} | {{ sed s/^/a/ & sed s/^/b/ & }}'
mfragkoulis commented 7 years ago

On Linux it works. On Mac the shell reports a SIGPIPE after the negotiation procedure has completed successfully, but that's only part of the problem:

sgsh -c 'echo hi | sed s/^/a/'

still outputs nothing although the script completes successfully. I notice a couple of differences in the way sgsh behaves on these two platforms. I'll try to sort it out.

dspinellis commented 7 years ago

For me it fails on stereo.

mfragkoulis commented 7 years ago

I'm on stereo too. I also located your script and used that; still successful.

/usr/local/sgsh/bin/bash --sgsh /.../simple 2>err bthere ahi

I notice the way you call sgsh and at first I thought it was a shorthand, but if not that's perhaps the reason.

dspinellis commented 7 years ago

Excellent, both work fine. I thought sgsh was a shorthand for bash --sgsh.

[dds@stereo sgsh]$ bash --sgsh simple 2>/dev/null
ahi
bthere
[dds@stereo sgsh]$ bash --sgsh -c '{{ echo hi & echo there & }} | {{ sed s/^/a/ & sed s/^/b/ & }}' 2>/dev/null
bthere
ahi