how to use command coproc inside a script
Command coproc in linux, allows peoples to create a new process in background and allows ones to send commands to it
It works very well from command line, but when I try to launch it in a shell script, nothing happens
Exp: I'm trying to anable scanning Bluetooth feature a a raspberry py
Form command line these commands work well
coproc sudo bluetoothctl
echo -e 'scan on' >&${COPROC[1]}
But ig I try to use them in a script like this
#!/bin/bash
coproc sudo bluetoothctl
echo -e 'scan on' >&${COPROC[1]}
the script does nothing
If someone can help
|