how to append text line after the last line in file without using echo command need example in sed and awk THX yael
+1
A:
Here's how you do it without sed:
echo "Hello World" >> file.txt
Here's how you do it with sed:
sed -i '$aHello World' file.txt
tylerl
2010-06-21 06:43:25
I cant use the echodid you have example in awk?
yael
2010-06-21 06:44:58
+1
A:
It's pretty easy to add lines with awk
by using the END
matcher:
awk '{print}END{print "another line"}' input_file
paxdiablo
2010-06-21 06:58:19
+3
A:
Without using echo
:
awk 'BEGIN {print "line of text"}' >> file.txt
printf "line of text\n" >> file.txt
cat <<< "line of text" >> file.txt
cat <<EOF >> file.txt
line of text
EOF
head -c 1 /dev/zero | sed 's/./line of text\n/' >> file.txt
read -p $'line of text\n' -t .00012 2>> file.txt
Dennis Williamson
2010-06-21 09:49:18