From: Christian Hofstaedtler Date: Sat, 26 Nov 2011 15:37:03 +0000 (+0100) Subject: Silence LOGFILE errors when using log too early X-Git-Tag: v0.17.0~48 X-Git-Url: https://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=769010633b88c8d6e5912fc02f46a6582f9598b7;hp=b010f18faf82ff5dbd5fb972fa4ff2b164ab0e07 Silence LOGFILE errors when using log too early Relevant when quitting grml-live at the question stage. --- diff --git a/grml-live b/grml-live index 3f42b78..73ee61b 100755 --- a/grml-live +++ b/grml-live @@ -196,7 +196,7 @@ trap umount_all EXIT # log output: # usage: log "string to log" -log() { echo "$*" >> $LOGFILE ; } +log() { [ -n "$LOGFILE" ] && echo "$*" >> $LOGFILE ; } # cut string at character number int = $1 # usage: cut_string 5 "1234567890" will output "12345"