pasadoorian / displaygoat

A crappy shell script that is used to display images on the screen from a specified folder. I will warn, its crappy.
GNU General Public License v3.0
1 stars 0 forks source link

feh failed if branch unreachable #2

Open krayon opened 8 years ago

krayon commented 8 years ago

Due to the backgrounding of the feh command, the following if is pointless. "$?" will ALWAYS be 0:

feh -R 3 -Y -x -q -D 5 -B black -F -Z -z -r ${BASEDIR}/${SHOW}/ & if [ "$?" -ne 0 ]; then echo "feh command failed, this is a big deal" | tee $OUTPUT exit $? else echo "Success: displaying the images for $SHOW" | tee $OUTPUT fi

May as well just write:

feh -R 3 -Y -x -q -D 5 -B black -F -Z -z -r ${BASEDIR}/${SHOW}/ & echo "Success: displaying the images for $SHOW" | tee $OUTPUT

Although that's inaccurate since feh may have failed so probably just:

feh -R 3 -Y -x -q -D 5 -B black -F -Z -z -r ${BASEDIR}/${SHOW}/ &