From bcd6a7e8bd6b53a2a45862980a9c1c7c7b6bd8ad Mon Sep 17 00:00:00 2001 From: hjp Date: Thu, 7 Sep 2000 08:44:42 +0000 Subject: [PATCH] Check for non-zero number of arguments for safety reasons. --- truncate/truncate.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/truncate/truncate.sh b/truncate/truncate.sh index 285fc93..fe1dcc0 100644 --- a/truncate/truncate.sh +++ b/truncate/truncate.sh @@ -1,7 +1,12 @@ #!/bin/sh +if [ $# -eq 0 ] +then + echo "Usage: $0 find-options" >&2 + exit 1 +fi @@@find_printf@@@ "$@" -type f -printf '%TY%Tm%Td%TH%TM.%TS %p\n' | while read timestamp file do - echo -n "" > "$file" + : > "$file" touch -t "$timestamp" "$file" done