Skip to main content

Questions tagged [coprocesses]

1 vote
1 answer
152 views

Suppose I have some process that when ready will output to stdout. Even though I want my script to run asynchronously with respect to that process, I still want the script to block and wait on that ...
Mathias Sven's user avatar
1 vote
1 answer
273 views

I am playing with the coproc of Bash and I am failing to understand something. I started with the following example: Example#1 $ coproc MY_BASH { bash; } [1] 95244 $ echo 'ls -l; echo EOD' >&&...
chemacabeza's user avatar
2 votes
1 answer
7k views

outer.sh: ls -l /proc/$$/exe coproc cat ./inner.sh kill $! inner.sh: ls -l /proc/$$/exe set | grep COPROC || echo No match found coproc cat kill $! When I run ./outer.sh, this gets printed: ...
Joseph Sible-Reinstate Monica's user avatar
0 votes
1 answer
697 views

I don't understand this sentence about Coprocesses in the bash man page: Since the coprocess is created as an asynchronous command, the coproc command always returns success. The return status of a ...
The Quark's user avatar
  • 454
0 votes
0 answers
486 views

Start some command with zpty: zpty -d x ; zpty x 'echo hi' ; sleep 1 How do I read its output now that it has exited? zpty -r x Returns 2, and this behavior seems expected per the manpage.
HappyFace's user avatar
  • 1,704
6 votes
2 answers
985 views

I have a requirement to make a function in a zsh shell script, that is called by command substitution, communicate state with subsequent calls to the same command substitution. Something like C's ...
Phil's user avatar
  • 175
0 votes
1 answer
487 views

I currently try to start background process with coproc and update a name reference variable. My not working code: function updateVariable(){ local -n myVar="${1}" #i=0; while : do ...
kon's user avatar
  • 123
1 vote
0 answers
56 views

I'm trying to feed to file descriptor .mp3 files the with the dummy interface of vlc, i.e., cvlc, in order to add to a playlist on the fly or override the entire file descriptor with new data (new ....
amosmoses's user avatar
1 vote
1 answer
1k views

I'm trying to do a simple shell script that will make my raspberry's bluetooth discoverable but i'm facing some issues. My raspberry is running Raspbian. Running this through command line works ...
Kamigaku's user avatar
7 votes
2 answers
2k views

The intent of the test script1 below is to start an "outer" coprocess (running seq 3), read from this coprocess in a while-loop, and for each line read, print a line identifying the current iteration ...
kjo's user avatar
  • 16.4k
10 votes
4 answers
6k views

I am trying to create a function that can run an arbitrary command, interact with the child process (specifics omitted), and then wait for it to exit. If successful, typing run <command> will ...
John Kugelman's user avatar
1 vote
1 answer
562 views

Note this passage from man bash ( emphasis mine ): Coprocesses A coprocess is a shell command preceded by the coproc reserved word. A coprocess is executed asynchronously in a subshell, as if ...
Sergiy Kolodyazhnyy's user avatar
5 votes
2 answers
3k views

I have read that $coproc < command > is different from $< command > & in that coproc will execute command in a sub-shell process. But when I tested it, it worked just like $< ...
Tran Triet's user avatar
-3 votes
2 answers
590 views

I'm trying to get the following code to read from a main input then read that in one function then be able to send that into the input of another function but i am having trouble getting it to work ...
Clark Kent's user avatar
3 votes
1 answer
463 views

While having a go at Convert date in bash shell, I tried GNU awk's coprocess feature: gawk -F, -v cmd='date +"%Y-%m-%d %H:%M:%S" -f-' '{print $5 |& cmd; cmd |& getline d; $5 = d}1' foo This ...
muru's user avatar
  • 78.4k

15 30 50 per page