can add a text line to text files?
can add a text line to text files?
As an example, I have learned the under-mentioned code. Code:
echo '/opt/lampp/lampp start' > /etc/rc.d/rc.local So, I should edit ever text files. Is it possible to add a text line to a text file? And one more, also is it possible to add a text line to some line of a text file? |
The double >> means "append at the end of the file", so that the original content of the file is preserved.
Code:
echo '/opt/lampp/lampp start' >> /etc/rc.d/rc.local |
You want to use >> to append text to a file, i.e.
echo "/opt/lampp/lampp.start" >> /etc/rc.d/rc.local This will append the text "/opt/lampp/lampp.start" to /etc/rc.d/rc.local. It will be on a new line if the last character in the file was a newline character (before the append, obviously). |
try this:
Code:
echo '/opt/lampp/lampp start' >> /etc/rc.d/rc.local use ">>" to append the new line to the existing text file. If you want to append this in a new line of rc.local then you should do this Code:
echo -e '/n/opt/lampp/lampp start' >> /etc/rc.d/rc.local |
colucix, Nylex, Matz/ Many thanks for your kind replies.
Quote:
|
All times are GMT -5. The time now is 02:39 AM. |