↧
Answer by Scott for Simultaneously check for empty output and successful exit...
First of all, while they are functionally equivalent, $(…) is widely considered to be clearer than `…` — see this, this, and this. Secondly, you don’t need to use $? to check whether a command...
View ArticleAnswer by ferada for Simultaneously check for empty output and successful...
You can assign the value to a variable and then check the exit status as well: PROBE_VALUE=`/etc/grub.d/30_os-prober` if [ "$?" -eq 0 ] && [ -z "$PROBE_VALUE" ]; then install_linux_only else...
View ArticleSimultaneously check for empty output and successful exit status
I'd like to write the following test in an installer script1: if [ -n "`/etc/grub.d/30_os-prober`" ]; then install_dual_boot else install_linux_only fi However, it's also possible that 30_os-prober...
View Article