Re: bash: return status of an assignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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.


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]


  Powered by Linux