Linux - GeneralThis forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
right... tether's end. searched thru lq and other forums and that well known search engine for some time, as i cant possibly be the first person ever to need to know how to do this. i can only presume i'm searching the wrong terms, or the terms im searching are just too common to find what im looking for specifically. time to ask.
i'm seeking to add multiple lines to the end of a file
and/or make a file with a number of predefined lines of text already in it
in a bash script.
i'd really rather not have to keep on doing echo addingthislineoftext >> tothisfile && echo addingthislineoftext >> tothisfile && echo addingthislineoftext >> tothisfile && echo addingthislineoftext >> tothisfile && etc. for the hundreds of unique lines i need to add, and would prefer to keep the text in the bash script, as a solid block of text as is to be found in the resulting file it's to be output to (to keep it easy to edit later incase i want to).
so basically, my question is, how can i add, via my bash script, a block of text (contained in the bash script preferably) to the end of a file?
any experienced bashers reading this with a suggestion?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.