From 07821f9cff6a37eddca05a66bb69d8f289c547f1 Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Tue, 5 Nov 2013 13:05:38 +0100 Subject: [PATCH] Simplify empty data file creation. No need to use the external cp command; shell redirection will create an empty file for us. --- todo.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/todo.sh b/todo.sh index 228fb04..7cecd7c 100755 --- a/todo.sh +++ b/todo.sh @@ -709,9 +709,9 @@ ACTION=${1:-$TODOTXT_DEFAULT_ACTION} [ -d "$TODO_DIR" ] || dieWithHelp "$1" "Fatal Error: $TODO_DIR is not a directory" ( cd "$TODO_DIR" ) || dieWithHelp "$1" "Fatal Error: Unable to cd to $TODO_DIR" -[ -f "$TODO_FILE" -o -c "$TODO_FILE" ] || cp /dev/null "$TODO_FILE" -[ -f "$DONE_FILE" -o -c "$DONE_FILE" ] || cp /dev/null "$DONE_FILE" -[ -f "$REPORT_FILE" -o -c "$REPORT_FILE" ] || cp /dev/null "$REPORT_FILE" +[ -f "$TODO_FILE" -o -c "$TODO_FILE" ] || > "$TODO_FILE" +[ -f "$DONE_FILE" -o -c "$DONE_FILE" ] || > "$DONE_FILE" +[ -f "$REPORT_FILE" -o -c "$REPORT_FILE" ] || > "$REPORT_FILE" if [ $TODOTXT_PLAIN = 1 ]; then for clr in ${!PRI_@}; do