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