[CentOS] bash: return status of an assignment

Sun Feb 28 02:27:03 UTC 2021
Gordon Messmer <gordon.messmer at gmail.com>

On 2/27/21 4:39 PM, Skylar Thompson wrote:
> You can fix it if you group the assignments together:
> [ -z "$INSMOD" ] && (INSMOD=$(which modprobe) || INSMOD="$(which insmod)")

They do need to be grouped, but if you group them with parentheses, they 
execute in a subshell, and the assignment is lost.  They should be 
grouped with braces instead.