Is there a way to only execute a command after another is done without a temp file?
I have one longer running command and another command that formats the output and sends it to a HTTP server using curl.
If i just execute commandA | commandB
, commandB
will start curl
, connect to the server and start sending data. Because commandA
takes so long, the HTTP server will timeout.
I can do what I want with commandA > /tmp/file && commandB </tmp/file && rm -f /tmp/file
Out of curiosity I want to know if there is a way to do it without the temp file.
I tried mbuffer -m 20M -q -P 100
but the curl process is still started right at the beginning. Mbuffer waits just until commandA
is done with actually sending the data.
(The data itself is just a few hundred kb at max)
commandA && commandB
? – eyoung100 Mar 04 '15 at 17:18commandA
tocommandB
, does it? – Josef Mar 04 '15 at 17:30--no-keepalive
? Or possibly you could try shortening the keepalive period with--keepalive-time 5
for example for a 5 second period. – Digital Trauma Mar 04 '15 at 18:30