From 3cb71891b68f93762f322980936e642fa0f685e1 Mon Sep 17 00:00:00 2001 From: Artur Nowakowski Date: Fri, 3 Apr 2020 14:55:16 +0200 Subject: [PATCH] Proper appending --- append_to_file.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/append_to_file.sh b/append_to_file.sh index 41055df..fab3c6d 100755 --- a/append_to_file.sh +++ b/append_to_file.sh @@ -1,4 +1,6 @@ #!/bin/bash mv $1 $1.last -tail -1000 $1.last >> $2 \ No newline at end of file +tail -999 $1.last > $1.last_1000 +cat $2 >> $1.last_1000 +mv $1.last_1000 $2 \ No newline at end of file