On the other hand, unix got many many, text manipulating utilities, and often, one liner to do text manipulation exist. From cat, to sed. And some an echo will do.
To append a line to a file, it just
echo "your text">> yourFilehere's a bit explaination, in layman term
echo "your text"will by default, print to your screen, which comes to
>>which means, redirect output to, somewhere. Another variation is, >, the difference is that, this will replace, the whole thing. >> will append
>> yourFilemeans redirect to your file.
And there you go, a one line to append a file.
No comments:
Post a Comment