If you have ever used Bash subshells ($(...)
), you know how flexible subshells can be. It only takes a few characters to start a subshell to process anything required, inline to another statement. The number of possible use cases is virtually unlimited.
This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-use-bash-subshells-inside-if-statements