From 98bfaa4e4aefdfc5f9a3ffddbe3766c336d0a781 Mon Sep 17 00:00:00 2001 From: Artur Nowakowski Date: Fri, 3 Apr 2020 15:00:30 +0200 Subject: [PATCH] Proper appending --- append_to_file.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/append_to_file.sh b/append_to_file.sh index fab3c6d..d27d702 100755 --- a/append_to_file.sh +++ b/append_to_file.sh @@ -1,6 +1,7 @@ #!/bin/bash +truncate -s 0 $1 mv $1 $1.last tail -999 $1.last > $1.last_1000 cat $2 >> $1.last_1000 -mv $1.last_1000 $2 \ No newline at end of file +mv $1.last_1000 $2