How to append several lines of text in a file using a shell script August 19, 2023 by Tarik You can use a here document: cat <<EOF >> outputfile some lines of text EOF