bash script includes?
I am fairly new to the bash scripting thing. I've written up a nice script to perform some automated work functions. But as I add to the script it has gotten longer and more difficult to manage.
Other programming types allow the use of include files. Does bash scripting offer such a thing? I tried searching for help on this and have not found anything concrete with what I need. The only include I found was in the manual page and it seems to just immediately execute the file. I have a number of functions or procedures in the script file and would like to let some of those reside in other files. That way I could keep the menu functions in one file, the file manipulation functions in another, etc. Any help would be appreciated. Thanks in advance. |
Welcome to LQ.
Just source the script to bi included - ie: Code:
#!/bin/bash |
That did the trick. Thank you very much. This makes debugging my scripts a bit easier than before. It also seems to be easier to add functionality to as well.
Maybe someday I will get into writing real programs in a real language. |
All times are GMT -5. The time now is 08:34 PM. |