View Single Post
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#699
Originally Posted by RobbieThe1st View Post
Oh, this brings me to another problem: Is there a good way to do an "include" of shell-script code in another file such that I can use pre-defined variables inside it? My main program file's getting big and complicated, and I'd like to just move chunks into their own files.
You should be able to pull in other files by doing ". filename.sh" - that'll run the file within the same process space (so any variables set will be remain when returning to the main script).