simple/truncate/truncate.sh

13 lines
235 B
Bash
Raw Permalink Normal View History

2000-08-23 15:03:42 +02:00
#!/bin/sh
if [ $# -eq 0 ]
then
echo "Usage: $0 find-options" >&2
exit 1
fi
2000-08-23 15:03:42 +02:00
@@@find_printf@@@ "$@" -type f -printf '%TY%Tm%Td%TH%TM.%TS %p\n' |
while read timestamp file
do
: > "$file"
2000-08-23 15:03:42 +02:00
touch -t "$timestamp" "$file"
done