 Hello, this video is part of a series before to check, be sure to check out all the previous videos and any other videos in this series by checking out the playlist. There should be a link in the description of this video. And today we're going to be passing variables to our functions in bash in our link shell. So last video we started and we created a script called func.sh and it has a simple function which should have this. So now if I run this after saving it, it has already been made executable in the previous video, you can see we have a little header with the date and time and then the messages displayed below it. We're using that function for the header there. But we can shorten up our script by passing it some variables. So what we're going to do here is put our echo command, see we're using the echo command and the sleep command over and over again which means they can also be put into our function. But there is a difference, we do have different text and the sleep function has to come after our echo. So let's go ahead and do this. What we're going to do is if you remember our video, a few videos ago where we passed arguments to our script itself, passing arguments to the function are the same way. So I'm going to say echo dollar sign one would be the first argument and then I can say sleep for two seconds after that. So now what I'm going to do is I'm just going to go like so and I'm removing the echo command from here because we've placed it inside our function and I can also remove these sleep commands. So if I typed everything correctly, I should be able to run this script and get the same output and we just shortened our script by six lines. Now let's say we want to have a different amount of sleep between each function. We can use that as an argument as well. I can go like this and say pass it argument two and here we can say argument two is well this one will be two seconds, this one will wait five seconds and this one will wait only one second. So now I can run that same script and this time it waits two seconds, text changes, it's going to wait five seconds before changing this time and then one second and exit. So we're passing arguments just like we did in the previous video of passing arguments to our script. We pass them to our functions the same way. So spaces, each space indicates a new argument unless you put quotation marks around it which indicates this is a single argument we are passing and is the first argument and again zero would be the function that you're calling. So we have shortened our script even more thanks to functions and being able to pass it different arguments. So thank you for watching. I hope you enjoyed this. We're going to do a little bit more with functions and variables determining local and global variables in our next video. So I thank you for watching. Be sure to check out that video by checking out the playlist again in the description of this video and if you enjoyed it think about becoming a supporter at patreon.com forward slash metal X 1000 even a dollar a month is very appreciated. And if you can't support financially think about supporting by liking, sharing, subscribing and commenting on this video. I thank you for watching and I hope that you have a great day.