## variables
function pho () {
- PHO_BIN=$(which pho)
TEMP=$(mktemp /tmp/pho.XXXXXXX)
- ${PHO_BIN} "$@" | tee ${TEMP}
+ $(which pho) "$@" | tee ${TEMP}
PHO_NOTE_1=$(grep ^"Note 1: " ${TEMP} | sed -e "s/^[^:]*: //")
PHO_NOTE_2=$(grep ^"Note 2: " ${TEMP} | sed -e "s/^[^:]*: //")
PHO_NOTE_3=$(grep ^"Note 3: " ${TEMP} | sed -e "s/^[^:]*: //")
PHO_NOTE_R90=$(grep ^"Rotate 90 \(CW\): " ${TEMP} | sed -e "s/^[^:]*: //")
PHO_NOTE_R180=$(grep ^"Rotate 180: " ${TEMP} | sed -e "s/^[^:]*: //")
PHO_NOTE_R270=$(grep ^"Rotate -90 \(CCW\): " ${TEMP} | sed -e "s/^[^:]*: //")
+ [[ "${PHO_NOTE_1}" ]] || unset PHO_NOTE_1
+ [[ "${PHO_NOTE_2}" ]] || unset PHO_NOTE_2
+ [[ "${PHO_NOTE_3}" ]] || unset PHO_NOTE_3
+ [[ "${PHO_NOTE_R90}" ]] || unset PHO_NOTE_R90
+ [[ "${PHO_NOTE_R180}" ]] || unset PHO_NOTE_R180
+ [[ "${PHO_NOTE_R270}" ]] || unset PHO_NOTE_R270
\rm ${TEMP}
}