]> diplodocus.org Git - flac-archive/blobdiff - fa-rip
De-zsh this so it will work in ksh93 and bash.
[flac-archive] / fa-rip
diff --git a/fa-rip b/fa-rip
index eabf52ea97878939f1418511c60f3aaaf190846d..b45b655f8733bf04bd3a3fe8c5504c27e7b14912 100755 (executable)
--- a/fa-rip
+++ b/fa-rip
@@ -3,12 +3,15 @@
 # $Id$
 
 set -e
-setopt NULL_GLOB
 
-get_cddev () {
-    local raw
+function get_cddev {
+    typeset raw
     raw=$(sysctl -n kern.rawpartition > /dev/null | awk '{printf "%c",97+$0}')
 
+    if [[ -n ${ZSH_VERSION} ]]; then
+        setopt NULL_GLOB
+    fi
+
     for CDDEV in /dev/{cdroms/cdrom*,cdrom*,rcd*${raw},{a,}cd*c}; do
         [[ -e ${CDDEV} ]] && return 0
     done
@@ -18,9 +21,10 @@ get_cddev () {
 
 if [[ -z ${CDDEV} ]]; then
     if ! get_cddev; then
-        echo 'CDDEV environment variable not set, defaults did not work'
+        echo 'CDDEV environment variable not set, defaults did not work' >&2
         exit 2
     fi
+    export CDDEV
 fi
 
 dir=$(mktemp -d flac-archive.XXXXXXXXXX)