From 769010633b88c8d6e5912fc02f46a6582f9598b7 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Sat, 26 Nov 2011 16:37:03 +0100 Subject: [PATCH] Silence LOGFILE errors when using log too early Relevant when quitting grml-live at the question stage. --- grml-live | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" -- 2.1.4