 and welcome continuing with our series on shell scripts 2017 and a few videos ago we went over some basics of functions but let's say you wanted to put functions inside a file that you can use with multiple scripts kind of like a header file in C if you're familiar with that at all well let's do that today I've already created a function or a script containing functions called functions.sh and here you can see we have three functions the first two just echo out some things like the Z test yay fun two says fun number two yay again and then function three which I called fun three asks you what your name is puts that in a variable and then echoes it back out to you so obviously we can call these inside here but let's go ahead and and again this doesn't have to end in .sh right your script doesn't have to end in that it could just be whatever file but I'm going to create a file I'll just call it go .sh it's going to be our main function we're going to want to be sure to tell our computer this is a bash script by giving it our shebang line there bin bash and then in here at the top we want to load up those functions again that file was called function.sh so I can say dot space and then I give it the name of the file which was functions.sh so now all those functions are loaded into the top of this basically it's like having them written there just like a header file in C so now I can call those functions I can call function two I can call function three I can call function one I can call function three again I can now save this and I can say I'm gonna make that script execute change one plus X go .sh only have to do that once on the system and then dot slash say run the script in this folder called in this case go .sh and I run that you can see it runs those functions what's my name my name is Chris so what's your name my name is Bob so that way you can create functions that you might use in multiple scripts but you don't have to copy them to each script and then because if you copy them to each script only is that duplicating you know the file but now if you need to make a change to one of those functions you have to go and change it in every file that you've put it in no you put it in one file and then you call that file whenever you need it so I hope you found that useful let's just real quick look at it again basically you create and you can have multiple of these you can have ten different ones up here but you say dot space and the name of the file if it's not in the current folder give the full path to it and then you can call those functions as if they were printed at the top of this script thank you for watching as always I hope that you have a great day please as it fills by Chris calm that's Chris the K there should be a link in the description also link to my patreon page where you help support me check out both those pages check out everything in the description and as always I hope you have a great day