JElchison / format-udf

Bash script to format a block device (hard drive or Flash drive) in UDF. The output is a drive that can be used for reading/writing across multiple operating system families: Windows, macOS, and Linux. This script should be capable of running in macOS or in Linux.
GNU General Public License v2.0
516 stars 48 forks source link

Clean up duplicate `false` logic for OS X #1

Closed JElchison closed 9 years ago

JElchison commented 10 years ago

See comments in code: "TODO not sure why the following is required on bash 3.2.51(1) on OS X (doesn't exit with false even with set -e)"

Example:

# verify that DEVICE doesn't have partition number on end, or that it's in OS X format
(echo "$DEVICE" | egrep -q '^([hs]d[a-z]|disk[0-9]+)$') || (echo "[-] <device> is of invalid form" >&2 && false)
# TODO not sure why the following is required on bash 3.2.51(1) on OS X (doesn't exit with `false` even with 'set -e')
RET=$?; if [[ $RET -ne 0 ]]; then
exit $RET
fi

There are several occurrences of this logic in the code (all marked with TODO).

JElchison commented 9 years ago

Unable to repro on 3.2.57(1)