Otherwise when running something like:
/root/system-info/grml-hwinfo --output-directory=/root/system-info/grml-hwinfo-data
via cron this store data to /root/root/system-info/grml-hwinfo-data
(instead of the requested /root/system-info/grml-hwinfo-data) since
/root is the working directory for cron.
# Generate output/temporary directory name & path, and output file path
[ -n "$OUTDIRNAME" ] || OUTDIRNAME="grml-hwinfo-${DATE}"
-OUTDIR="${WORKING_DIR}/${OUTDIRNAME}"
+if $_opt_output_directory ; then
+ OUTDIR="${OUTDIRNAME}"
+else
+ OUTDIR="${WORKING_DIR}/${OUTDIRNAME}"
+fi
+
if $_opt_force ; then
mkdir -p "${OUTDIR}"
else