[hackers] [dmenu][patch] avoid some forks in shell scripts

From: Glen Mével <Glen.Mevel_AT_crans.org>
Date: Sat, 10 Aug 2019 23:32:14 +0200

Explanation: with common shells (sh, bash, zsh at least), the chain
`echo cmd args | $SHELL` leaves an unnecessary shell process, waiting
for its
child process `cmd` to complete. Whereas `$SHELL -c "cmd args"` only
leaves one
process `cmd` in the system.

My guess is that, in the second case, the shell is able to see when
there is
only one command to execute, and in this case it saves a fork operation.
in the first case, there might be subsequent pending commands to

Glen Mével

Received on Sat Aug 10 2019 - 23:32:14 CEST

This archive was generated by hypermail 2.3.0 : Sat Aug 10 2019 - 23:36:25 CEST