I need a script that add a particular character to the end of each line . I am using the command
sed 's/$/ foo/' r.txt
It adds foo to end of each line in the file r.txt and displays in my terminal . What do i need to do if i want to save this existing file with this new record appended after the end of each line .