[gull] Truc et astuces: bash connector
felix
felix at f-hauri.ch
Wed Feb 14 21:59:04 CET 2018
Alors j'avais écrit:
On Fri, Feb 09, 2018 at 10:02:05AM +0100, felix wrote:
> $ ps --tty pts/20 fw
> PID TTY STAT TIME COMMAND
> 29019 pts/20 Ss 0:00 bash
> 30944 pts/20 S 0:00 \_ bash
> 30945 pts/20 S 0:00 | \_ /usr/bin/bc -l
> 32615 pts/20 S 0:00 \_ bash
> 32616 pts/20 S 0:00 | \_ /bin/date -f - +%s
> 3162 pts/20 R+ 0:00 \_ ps --tty pts/20 fw
Et y'en a pas un pour me dire que si au lieu de
newConnector() {
local command="$1" cmd=${1##*/} args="$2" check="$3" verif="$4"
...
eval "exec $fd> >(LANG=C stdbuf -o0 $command $args >$FIFO 2>&1)
...
j'avais mis un ``exec'':
newConnector() {
local command="$1" cmd=${1##*/} args="$2" check="$3" verif="$4"
...
eval "exec $fd> >(LANG=C exec stdbuf -o0 $command $args >$FIFO 2>&1)
...
j'aurais pu libérer le bash intermédiaire:
PID TTY STAT TIME COMMAND
3876 pts/20 Ss 0:00 bash
3907 pts/20 S 0:00 \_ /usr/bin/bc -l
4959 pts/20 S+ 0:00 \_ /bin/bash ./shell_connector.test
4963 pts/20 S+ 0:00 \_ /usr/bin/bc -l
4968 pts/20 S+ 0:00 \_ /bin/date -f - +%s
4973 pts/20 S+ 0:00 \_ /usr/bin/sqlite3 -separator ? -header /dev/shm/test.sqlite
4981 pts/20 R+ 0:00 \_ ps --sid 3876 fw
... on se demande si y'en a qui suivent!
;-)
--
Félix Hauri - <felix at f-hauri.ch> - http://www.f-hauri.ch
More information about the gull
mailing list