Quantcast
Channel: Simultaneously check for empty output and successful exit status - Unix & Linux Stack Exchange
Browsing all 3 articles
Browse latest View live

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 Article



Answer 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 Article

Simultaneously 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
Browsing all 3 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>