All right, welcome everybody. This is bashful2bold a bash primer or a tutorial on bash First of all welcome. Good. Good morning. Good afternoon. Good evening Wherever in the world you are and whenever you are watching this Super happy to have the opportunity to do this as a virtual presentation While I'd much rather be doing this in person. We're ticked opportunity learn a few new things learn how to record a video and Hopefully have some fun with this. I try to make this as indirect as possible way. It's live But I'll try to make as entertaining as possible here While it's being recorded my goal here for the presentation in the tutorial is that you leave with Just a little more knowledge or a little more insights than you came with That being said I think it's hard to leave with less insight, but who knows right? My name is Alex Juarez and I'm a principal engineer at Rackspace So getting started with today our agenda is a couple things, right? So we're gonna start off in a maybe a non-traditional way But also delivering this virtually is not traditional. So it works out We're gonna start off with a bit of breath work technique called box breathing Then we'll go into bash foundations understanding and level setting the building blocks that will need for Jumping to our next section, which will be bash scripting after that We'll talk about some resources and then we'll end the session the way we began with a bit of box breathing as well again so Requirements for this tutorial or this presentation. I try to Assume as little knowledge as possible when it comes to these introductory topics That way we can include as many people as many experiences as many Knowledge sets knowledge levels as we can here If you are just starting out the hope is that you have a Bit more insight it can learn enough to ask better questions And if your Experience level is just maybe higher with more tenure Then I hope that I may be introduced something that you haven't seen before or maybe have forgotten about and remind you of that So my hope is that anybody at any level can get something from this The scripts that I'm going to be using in the tutorial can be found on get hub And the link is there below I'll get up comm slash mr. Alex what is slash OSS bash primer and the nice thing here is that that set of scripts and that And these slides will be kept there updated as I decide to add more to the presentation or more to this information and About this tutorial so this tutorial is about 75 to 80 instruments somewhere in there of Curated content from multiple sources and multiple years of working as an administrator and as an engineer There's no way we're going to cover everything within this time frame So my idea the idea is that I will take the highlights What's been most useful to me over the years and try and combine it to a short quick session after that the idea is that perhaps you have just a bit more information to Go in ask better questions or do better do better Google searches. So you have that information to kind of build off of So getting started with box breathing now you may be asking yourself why begin a presentation on bash with Breathwork and the idea here is that when I initially proposed this presentation obviously it was going to be in person and I had an idea around create the script I think one of the best ways to learn something is to Have a project or something goal you're trying to achieve and There's some sort of different script or different goal But as things begin to change as we learn that this will be virtual This idea came to mind where to teach a bit of breath work As people have been working from home or different locations and things have changed in the workplace the things that we may usually do to de-stress or unwind or Take a step back may not be available to all of us But one thing that's always available to us is our breath right it is Be able to breathe and a beard that can breathe in a controlled fashion So I wanted to do introduce the idea of box breathing Because for me personally, it's been a tool a valuable tool to Center myself get my day started If I find myself in the weeds or I find myself head down, you know, because the problem I can take a step back do a bit of breathe breath work and then Resenter myself and so For me it's helped with a lot of anxiety and stress and even according to the Mayo Clinic The there's some benefits of deep breathing that have been researched in that they could ease the symptoms of stress-related disorders such as anxiety general stress depression PTSD and things like that You said for me, it's mostly the idea of sending myself and bringing Myself present to the work. I'm doing So the steps for box breathing and like I said the idea is that we're gonna learn this skill this technique And then we're going to the scripts. We're gonna build are gonna be around Having a script for ourselves to do this In the beginning here, I'm gonna guide you through the first part of box breathing and Then at the end we'll have a script that we can run that's gonna help us guide through as well. Okay, so I'm trying to guide you all through this breath work here If you're not already seated find a comfortable seat find something that is it's comfortable sit on Feet on the floor feet grounded preferably bare feet have your feet touching the ground make that connection with your body The the steps here are simply we're gonna inhale for four seconds. We're gonna hold that for four seconds Exhale for another four and then hold for another four seconds before going through that cycle again and so the Step here I said find comfortable seat The on the ground If you can lift your chest a little bit and maybe Bring your shoulders down your back, right? This is the yoga teacher in me trying to get to the right position here I invite you to close your eyes if that's comfortable for you. It's not that's perfectly okay And we're gonna get started here with just guiding you through this box breathing as you inhale for one two three four Hold that breath for one two three four exhale for four three two One and hold one two three Four, you know the round as you inhale for one two three four holding for one two three four exhaling for four three two one holding for one two three Four and then our last round as you inhale slowly for one two three four holding for one two three four exhale for four three two one holding for one two three four and Just opening your eyes Taking a few breaths in and out inhale and exhale Kind of shake off any kind of Pent up movement you might have and we get settled down to begin our bash learning here Okay, so jumping into our bash foundations And we're gonna start at the very beginning here by answering the question. What is bash? And it's as simple as forum bash the shell for command interpretation. So so what does that mean? What's a shell a shell is just a program or a terminal where we type commands in and get a chance to interact with the system bash was first released on June 8th of 1989 and actually replaced a Shell before that called the born shell. So bash is actually a combination of born again shell which replaced that born shell In 89 so again, there's some bit of age on this has been around for a long time And that has been the default shell on a lot of systems for for quite some time So I think it's pretty safe to assume that it's going to continue to be one of the default shells or at least a shell available On system for for time to come for a long time to come So let's start off with what happens when you log in right because when you log on to a system Via SSH or at at the prompt certain things happen that gives you a a terminal or prompt and so While much this is covered over under the invocation part of the man page Kind of want to go through it and show you what it looks like. So if we have a system here Actually, let me there we go. We're on a demo system here. Okay, so if we're on system here so what happens when I logged in there is that the system checked my username check my password and Then says great those both pass Let's execute your log in shell in this case batch, but how do we know that? How do we know we're running bash? How do we know they are logged in shells bash? There are a couple ways we could do that. So when I give presentations I always like to give kind of auxiliary data or auxiliary Commands information so that it kind of all helps come together And so in this case here, I can write a command called who am I will give me my username in this case It's root. Okay. Now if I use grep root from Etsy password Okay, grep being a command if you're not familiar with it to Essentially search through a file for a specific string and return that string to you And we see here in this first line here a Root and then the last part we don't even know about all of the other fields But this last part here is is bin bash. So this tells me that for the root user The login shell is going to be bin bash. Now Maybe bash is alias or maybe bash is bashes connected to something else. So let's take a look at that as well I might say which bash I Can see here a user bin bash. I might say LS dash LAH for user bin bash And we see here that it is a Is a file it's not a simulink right so we're pretty sure that our our default shell here is bash Now I do a couple things here. We kind of begin to Expand upon highlights some of the things we do For for one liners for scripting Earlier I did command who am I I gave me a root But say I wanted to do this for a lot of different users. I might say grip Who am I? Right and then at the password and so that This here is essentially executing the command and returning and replacing that That value it came out in that in that variable So who am I is in returning who as a root and then so it's going to be just a This is like similar thing we did before grip who am I at the password? It's just combining those two commands who am I and then the threat with one command Okay Also, I might say which I might say LS dash LAH and say which That's Right, so if I do a which bash again, that gives me the full path of Bash whichever can be called in my path and we'll get that a little bit and it gives me a Long list here, but so I can see what that looks like at the terminal Okay So so invocation. So what happens when we log in now? I mentioned that a lot of this was under the man page for bash if we look under Man bash and go under invocation Come back a little bit you see here a big breakdown of what happens when we log in Because bash can be run in a couple different ways It can be run as an interpreter to interpret a set of files or its commands in a script It can be used to run different commands at certain times Think about something like cron when cron runs it launches a bash shell to run a couple of different commands And so we have different I did different things get lowered up depending on how bash was started For most of us and especially in this presentation We're looking at bash as a log in shell And so what that means that as a log in shell it loads specific files whenever it gets started up Okay, and I'm breaking this down because it's good to understand that nothing in this realm is is magic There even though sometimes may seem like it. There are always there's always a reason There's always a setup for why it something is a certain way and So this is all come up to say that when bash has started it goes through and loads up these files In particular order and so we look at them very quickly here at the profile I Will begin to see some of the things that get started up gets loaded into bash, right? So we see here. Maybe that our Hostname variable gets set or that our history size is set Okay Things like your you mask right so how where your default permissions all get set up from at the profile From there it might load something to see Maybe a bash profile local profiles, right? So when you see at the profile loads this when you see this this till D right here It's saying load it from my home directory right my current home directory So if we want to expand upon what the defaults are for for us internally for our personally our user account We can go to do so and add it here within a bash profile a bash login or a dot profiles Well, you might also see a dot bash rc file which can get loaded which is loaded as well as part of the invocation process so moving on to environment variables, so a way to look at our environment here is Actually sit back take a step back here. So the print E and V command What's going to do is going to display our environment variables for us And so when bash loads up and loads those files a lot of variables get loaded in that So we can use in our one-liners or our scripts It's something that just a lot of defaults that bash loads for itself So real quick an example of print E and V. So if you print E and V we get to see a lot of the Default variables get set up. So If you look here, we see that LS colors. It should say this is the way Our screens get colored up if we have that turned on We'll have the present working directory Right, we have the home directory for the user and Just a similar kind of interesting things Like your login name history size. We saw that get set in the Etsy profile So again, it's kind of begin to show you where things can get set up or how they get set up as you log in Okay, I'll all this happens behind the scenes But I think it's nice to know. Hey, this is where it comes from. Okay, and like an echo path or echo His size right so Here in this I'm showing you all is using the echo command to display the contents of a variable When we have we're looking at a variable we prepend it with a dollar sign That's a dollar sign path or dollar sign history size his size to see what that that variable looks like Okay. All right, so now it's looking at setting and exporting variables begin to see a lot of different things as we Try to expand upon knowledge or expand upon our usability One thing we're going to want to be able to work with our variables to set data first for certain variables So the first thing here It's fairly easy to set a variable on the command line. Let's say we're going to say that customer of my bar equals Hello world Okay, and it's simple to call that variable and say my bar Hello world very simple now if I went into a script and I want to Use this variable within a script It wouldn't be available because it's local to this this session or this terminal If I do a print EMB and maybe grep for my variable We wouldn't find it there. That makes sense So now I'll go ahead and do an export My variable my bar And I can come back to print EMB now we see it there So so what this means is that this variable now has been exported out to a more low or larger Scope I can begin to use it within within scripts and kind of have that variable set for myself So let's take a look at that what that looks like. So I have a simple script here. I go to Here you go. This test script here. So custom bar equals custom bar Let's clear us out a little bit and let's say that echo my variable And if I say bash test script We'll see that hello world comes out Add upon this a little more here and say Variable equals Test script my bar equals hello world So let's expand upon this a little bit here So we can kind of see the difference when we have a set of variable and when we export a variable for use in other areas So if I just set another variable and say set bar two equals How are you very simple? Oh, sorry. I think that's it off. We don't need that set there. We just need Bar to and notice also that we don't have any spaces between the equal signs and the rest of the right-hand side of the variable We do that here. Okay echo Part two Sorry echo Thousand bar to be have. How are you? I go into my script my test script here and say Echo here bar to equals Bar to and say that run our test script bash test script We see there's no value there for bar two, but now if I export Bar to and write again Now we see that bar two is available to us within the script. So That can be helpful when you have to write custom scripts or set some custom data and Be able to set the variable and then use it within your scripts Okay, we can even take that a step further back and say that if We had something we always want set up We might set that variable within Etsy profile or within a bash RC file within our home directory so again, we started to build over that how can build our defaults how can get our Our environment set up in a way that we was useful to us, right? All right, so we did the export these some of these slides are just reminders for me to jump back to a Terminal and do a demo or do you kind of show what we're trying to talk about? So the next thing I want to talk about here are bash built-ins So these are a set of commands that are built into bash, right? So There is no other need to I guess step back a little bit traditionally when we execute command from bash It does a thing called forking essentially it creates a copy of that and launches a command in the in the background of the foreground depending on how it's set up and Ambassador needs to run so but these commands are set up so that they are built within bash itself So there's no need to execute a new command This is common handy or this concept is common handy a couple times in the past and It's very rare, but when system maybe has too many processes and it can no longer create more kids Having something like the kill command be a bash built-in There we go not having to start a new kid is helpful Okay, and so let's take a look at this Wait, we can kind of figure out what some of the bash built-ins are by using the type command And so let's take a look what that looks like So if I'm here, I say type bash This bash you look at man, right?  Let's say let's do a type kill You say kills a bell shell kill is a shell built-in. Okay, let's do a man type And if I do a man type this actually gives me to the man page for a bash built-ins And you can see here the top of the screen all the different commands that are built into bash Okay, so alias if you wanted to create an alias if you wanted to bind a a directory to a mount point right if You wanted to see a few things here export as we use earlier is another bash built-in Right, so jobs kill let let we'll see later on for arithmetic evaluation That's a couple different things here That I'll get all become bash built-ins Okay, and I won't go over the whole page here But there are the only commands that are available to us without me to spin up a new pit or a new process ID So a checkpoint slide I like these slides to essentially make sure we're all on the same page of how far we've come So so far in this presentation. We've covered a bit of breath work. So box breathing, right? So inhaling holding exhaling holding all four equal amount of seconds. So in this case four seconds We covered what happens when you log in simply all the things that get started up when you log onto a system the SSH or of the Terminal we talked about setting and exporting it bash variables again This is one of the building blocks of being able to harness the power of Creating one-liners or creating scripts to get on that your tasks for you And then last about bash built-ins like in a series of commands that are just built into bash there for you ready to use Getting always count them being there Now I want to talk about IO redirection. And so this is one of the fundamental concepts that we talked about in That begin to really help us build our Our scripting our one-liners, right? So the concept here is that every system or every command sorry has a standard in a standard out and a standard error And we'll kind of dig into what that looks like here and when we understand this concept that we begin to take the the output of what command and Either redirect it to a file or as we'll see later on here pipe it into the input of another command so talking about redirecting output to a file, so Usually when we type a command the output or standard out as you see here goes to a terminal and so we can redirect that output to either a file where we Create a new file and put it there or we append to a new file or to a file And not overwrite the whole thing with the double brackets. Okay, so take a look at that here real quick Okay, it's a very simple demo. I might say that I might catch Etsy Password, right? We have some mission here, but maybe I want this output be saved into a file for later use so maybe I'll say Can't see password and then redirected to Temp password file and we see here that we've been new file Right and kept Okay, simple redirection sometimes we can we can build upon it if you wanted to have a number of scripts begin to Sort that data if you will and so real quick here also if I'd say Or the echo Hello The output we get my hit enter right the output comes to standard out If I say echo hello, and I use a single bracket to say temp password file Cut that out We've overwritten that file now. So if we had to double brackets that would append the file append to the file. So Let's see here I go line two and we're going to append with double brackets to the temp password file Cat that out And we see here that we've appended to that file This can be understanding this and using single brackets versus double brackets can be The difference between Overwriting a file that you absolutely need or just appending to a file that you want to keep adding to So, okay, so let's take a look at last and tack the command line here. So I do the last Pipe to tack. Okay, we get something that that this app would hear a good get a last being the The sorry the last Successful logins. That's amazing note here. Last B is The last bad logins or failed logins. So it's kind of nice to know Just a quick little bit of information there as well So back to our example here at last. So last year gives us the last successful logins where they're from Things like that, but it begins. It gives you an order where the The most recent is up is up top. Okay? I maybe I'll do this here. I'll do a last and type the tap again and Then we see here that now the most recent in the bottom now again for your personal usage of This this these command that your your usage may vary on what you want to do with it So let's break this down a little further If I look at tax attack is just cat backwards. So if I cat a file, I get you know line one two three four five But your cat say one two three Or he begins to just output those lines for me But I could cancel that out by you tack If I do here one two three four five and then close it out I get five four three two one again print it out backwards Thank you an idea of how the two commands work independently now. So when I say last Right remember I talked about earlier like standard out standard inside out standard error Why do you last standard out goes to the screen usually and So last gets print you standard out when I do last pipe tack Right, so now I'm saying I want the output of standard out So I want the output of standard Out so the command to go to the input standard in Tech the next file That's how pipes connect to commands together again That's really gonna be one of the prime things that help you build your your one-liners or your Scripts later on so Again another checkpoint slide make sure we're all on the the same Slides in page here. We've talked about the IO redirection. So Taking the idea of standard in standard out standard error and what that means Then also redirecting that to a file so using these Angle brackets angle brackets So one of them would again go ahead and overwrite a file and then two of them is gonna pin to a file And then lastly we talked about pipes again connecting the output of one command into the input of another jumping into our bash scripting portion of this tutorial this presentation so Looking at our first first bash script. We'll break down the shebang line This is the first line. You'll see a lot of Scripts on the system. It essentially tells the system how to interpret the following commands We'll break that down a little bit We'll talk about making a script executable and making it more available in your path And it'll talk about some bash special variables that are available to us to Making it a little easier as we begin to write our scripts out So The whole shebang right so taken from putting together the pound symbol or sharp if you come from music and The bang or the exclamation point. This is kind of that that word shebang kind of comes from a Joining of those two words and essentially what you need to know about that is that it tells the system How to interpret the following script or the following commands?  Hey the following commands the following things in this file It should be interpreted from a bash shell or a bash prompt You might see also maybe pearl right so Been pearl that's telling the system. Hey run this through pearl as its interpreter So it kind of gives you an idea of how the file is interpreted or what happens at the very beginning of the file Most most often in most scripting languages or most interpretive languages It is the pound symbol acts as it is the Didn't know it's a comment, so it's not so interpret it It's our executed by system. It's kind of interpreted say hey, this is what we're running the Script through So the next step here is making those scripts executable So earlier in the presentation you saw that we maybe did something like bash and test the script Okay, now let's create a new script file camera on a new file for us So it might say vi new script s h and really that s h is just for Just to know what we're calling to know what it is.  This tells us hey We're going to run this command or the following commands through bash And maybe I'll say echo Hello World yeah very simple How do you bash and say new script We get hello world. Okay, so this happens that this it's running the script a bash run this script Very simple now another way you might see a script run is by doing a dot slash. This tells me hey within this path run new script Okay It says permission to night that's because the script is not executable So we see here on our new script Looking at permissions here. We don't see xq a bit on there Notice from our test script earlier. We do see that so a very simple shaman plus x on our new script shaman sx new script And we say new now we say to look here at our new script permissions See then we have Xq a little bit on there and we'll say new script Okay, so now we can you act as it from dot slash right? But let's say that we wanted to have this script available to us or the user without having to type in dot slash or anything like that We would want the term that we want to put this script in our path So that bash knows where to look for it and Take a step back essentially the path is just our path Variable is just the series of directories that bash looks for a command So we echo half we see here that we see here that When bash looks for a command it's going to look through user local sbin user local Ben user sbin user bin and then finally root bin So this tells me that I can put a Command or a script within a root or slash root slash bin and have that available to me in my path Let's let's try that out now So if I type here I say new script Try to type it out and see it But if I go ahead and move new script to root bin Now We'll see that new script shows up as an option for a tap complete within our within our shell because again bash searches that path for try to complete that name we're typing in And now I can execute it without the slash without having a few bash And put the script there So again, this is going to be helpful when we create our own scripts for our system And we want to make sure that they're either available to everybody else or they're available to this user all times at any place That would to type in the full path and just make things a little bit easier Now I'll talk about some some bash internal variables and these this is only a subsets a very small subset of all the variables that Uh could be available to you now, uh I think these are some of the most interesting ones or the ones that are most useful so the Echo dollar sign question again when we try to display the contents of a variable We use the dollar we prepend it prepend it with the dollar sign and then Uh whatever variable or special character that I beat to get the the output of that so echo dollar sign question mark is the Exit code or the turn value of the last command ran This can be useful when you Want to make a decision when based on whether or not the previous command was successful or not Okay, uh, and we'll as we get to our if statements Here in a little bit. You'll see how that becomes more useful another one we might have is Echo dollar sign dollar sign. Uh, this gives us the PID or the process ID of the the script that we're running So maybe that I look at my Test script here And say it's been like echo dollar sign question mark and echo Two dollar signs, which will be again our process idea of the script And then as we see here test script I'm going to return code being zero like a whatever of whatever command was run before that So in this case, it would be that previous echo and the PID of the script itself that last number should be increasing Constantly as system spins up processes and turns them down and then lastly here I think this is probably one of the most important ones when we talk about uh writing scripts for ourselves is The parameters passed to a script are stored in these, uh, dollar sign zero dollar sign one dollar sign two Etc variables. So what that looks like on the on the system here If I were to say let's edit our test script and say that echo The name of the command is Dollar sign zero dollar sign zero is the first variable there. So it's usually the name of the command itself And then let's say echo This is the first argument Our parameter And so now let's try this do a test script and we're going to say with, uh Parameter parameter one Okay, so now we see here the last two lines here the name of the command is Test script and then the first parameter is parameter one. Okay, again, essentially it's spaced limited on the options up here Again as we begin to build our scripts, it's gonna become more more useful on the command line in a one line like this Not so useful per se, but as we begin to build our scripts, we'll see that a little more a little more powerful So again just a really quick checkpoint slide to make sure that we're all on the same page So far in addition to what we've covered in the past we've covered The shebang line or the command interpreter. So again the very first part of a script here That bin bash is known as the shebang and then again It's the way that the file will be interpreted This says hey the following commands should be interpreted through through bin bash essentially Talked about making a script executable and putting it into your path again That's super important if you want to make a script available to us anywhere on the system not to have not have to type in the Full path of that file and then a couple of bash internal variables That can prove to be useful and you can do a quick google search for bash internal variables or bash built-in variables Or even bash and then dollar sign question mark can get a list of all those different built-in variables So a rhythmic operators or epic operation operations. So like most things Bash has the ability to do addition and subtraction you can increment and decrement automatically by one or two whatever it might be a pretty pretty standard operations for for most scripting languages And it's pretty simple here as they have most of the things Are pretty self-explanatory right so a plus sign you can do minus invocation or division You have to have a whole list of them here under advanced bash scripting guide Which you'll see here a link to this will be included towards the end of the other presentation or end of the resources If you search for advanced bash scripting guide, you'll find that pretty easily So one of the big things when we talk about Going through loops and we'll do our next section if we one thing we want to need that the one thing we need to know before that is how to Increase or decrease the value that we want to to gauge against right so a couple ways we could do that We could encase it in two two sets of brackets or we can say let and then uh the arithmetic operation we want to perform remember let being a bash built-in essentially evaluates that that arithmetic Statement so in this case here. This is shorthand for essentially i plus equals i equals i plus one or i equals i plus two right whatever The reverse also true if you had a minus minus here it would be Decrementing that or decreasing that that number so i minus minus essentially is shorthand for i equals i minus one again. This would become more powerful within our loops But taking a look here under our directory with two scripts bash So here I have a couple of examples in how this works out and we see here that i is equal to one so we're setting a variable The cycle just says hey, that's the end of that line and which for Make it easier to read. We're putting all this on one line here Then we're going to echo out i equals to the value of i And then a comment here saying hey set i equals to one Now this next line here if we just had i plus equals two Again, we set a variable with i equals one We'll try to do it with i plus equals two What we'll get here is not so much the numeric addition of one Plus two right so in this case it would be three We get almost like a string addition so that it appends the character two To the numbers making it 12 Which if you're just starting out if you're just beginning to Work with numbers or adding subtracting in a bash script can be very troublesome. So I want to highlight it here So echo i equals i add two to i right so Again, this would be a long form to what we usually think is a long form for i equals i plus two In this case here it becomes i equals 12 If we do that again just for examples here i plus equals one Again, we'll have i equals 121 again if you're just starting out this could be really just Defeating or troublesome to troubleshoot right? Now looking here earlier or we said earlier right left so let now we're evaluating our rhythmic operation So we say let i plus equals two Then then we're actually incrementing the The value of i by two in this case 123 and then we see here The another way to do that would be to say in the double brackets or double double braces i plus plus or plus plus i now this order here Doesn't make a lot of difference when we are putting it in a single line like this But when we talk about loops it does make a difference right when we go through a loop it says hey I want you to Evaluate the value of i for this loop and then after the loop is done Increase it by one And sorry this one here is going to take the i value of i increase it by one after the operation This one here says before the operation increase the value of Of i now usually you're going to see it in this way here i plus plus But i'm highlighting this just so if you see it later on you know, hey i've seen this before I kind of remember what that means. Let me go look it up again. Simple as that So talking about functions Okay, so functions become a way to Run through a set of commands that can be grouped together or is and reused within it within a script, which is quite nice And they're very they're called very simply here. We have the uh keyword function The name of the function and then we increase the case the uh commands in curly brackets So if you have the function you might have command one command two and it goes from there So functions are super powerful, but also very easy to set up which which is nice Now to have a control statements, okay, I think we're back now One of the fun things about recording this ahead of time is that sometimes the light you're using Can go out and you have an opportunity to stop and you know get set up again So back to our presentation talking about control statements, so There are a couple ways that I mean it's pretty common for a lot of scripting languages Bash included in that and so we're talking about an if loop a for loop a while loop And then switch statements and we'll begin to look at our script and build a script out to around these things So for loops for loops are pretty useful, I mean pretty useful in any scripting language, but when we want to execute a A series of commands an exact number of times, right? So we say that I want to execute this command 10 times For loop is great for that So the way we set up a for loop in bash. It is simple for Bar in sequence. So sequence can be Uh, a series of numbers it can be the command sequence. It can be a series of strings or a series of strings And for that part we say do command one two and three and then we say done, right? So do Command one and two three and then done, right? So let's take a look at what that looks like as an example So we're going to take a look at a very first version of a box breeding script And I had that written out. It's part of the get hub rebose. You can see it there You can copy and paste it. You can type it out side by side I prefer to If I'm doing this for the first time type it out if I have the script that way it becomes a little more tactile I kind of have a little more time to study each of the lines and understand what they're doing But for this presentation, I'm just going to bring the script up It's already written and kind of go through it line by line. So we know what's going on If you'll remember that the box breeding was a simple four-step process of Alternating your your inhales holding exhales and then holding again for for a number of seconds So let's take a look at box breeding version one That's a very simple script here Again, we take a look at line by line here. We see here as you set There we go set number. Ah, sometimes I forget So looking at line number one, right? We have our interpreter bin bash Now here we're setting two variables up We're setting up a variable for the number of rounds that we're going to do box breeding for and account for the number of seconds. We're going to Hold or inhale exhale. Actually, I'm going to go in here and add a couple things and add comments says The number of rounds We are going to And then comment here and say how long we will hold Each section Okay now Again, here we have echo starting box breeding for x number of rounds in this case here It's going to be whatever remember we saw this earlier dollar sign one is the The Essentially the second parameter we passed to the script or the first parameter that's passed to the script Dollar sign zero being the script name itself. So here we go X it's a dream of four loops x equals one and we say that for i in sequence rounds, so remember this this this notation here says I want to I want the output of the sequence command for That variable there and somehow turning the Screen saver on it is not the easy thing to not do. I'm sorry about that. So for i in sequence rounds Real quick. Let's step out of this file here and just show you what that looks like. So I do a sequence command and say sequence four right one two three four I do a sequence, uh, 10 right a sequence two ten one or say two Not that uh two ten Right so it goes from two to ten Uh, we say sequence one to five right So again, we just generate a sequence of numbers two man sequence here That's what I'm looking for here the first the increment and the last so let's say we do sequence one two ten So here every other every other number. It's a one three five seven nine Get towards uh 50 if you will right again to generate the sequence of numbers start zero There we go so again, just itched a way to Generate a series of numbers so Take a look at this with again. See vi box breathing. Yeah, bob vi box breathing version one Just like a live demo right even though it's pre-recorded. We get a chance to see some typos and Realize that nobody can really type when they're being watched in this case here So for this this sequence here, we're going to go for i in sequence rounds. We know that this it's going to generate a list of numbers one through four we're going to do For each step we're going to do that we do the following commands right so echo round whatever x this is And actually this should actually be For i in sequence. This is going to be i Little typo there and this will all get pushed to the The most updated version of the get repo so for i in This either so for i in sequence so for i in one through four echo Round right would be one two three four and then we're going to inhale for count seconds right so count being Count being in this case four we could change this to fit wherever it fits our breath right And a very simple inhale sleep we're going to sleep for the same Count seconds right so it's going to be a very very simple script here. We're going to hold count exhale count And then come down here and say x equals x plus one We very easily could also do As you saw earlier x plus plus as well Okay, so let's see what this script looks like when we run it box reading version one Okay, so notice here we have because we didn't have a parameter We have an error And actually the error comes from the sequence command So let's go ahead and add in a number here and we'll say two rounds I'll just do one round first just so we can see what it looks like Sorry a box reading for one round Round one inhale for four hold for four Exhale for four seconds And then hold for seconds again Okay And notice here also that the last part there We could have it do a little bit more but this again, this is this is the first version of the script And so we look that again again just highlight here This is a for loop looks like again. We want to execute a a set of code a Exact number of times then we'll use a for loop So let's save that and jump back to our presentation here So if loops so if loops it says, hey, we have a decision to be made And so there is some sort of test when you do if greater than if x is greater than 10 if true If false, right? We do some things like some fun things like if a file exists or if the string is zero or empty Right. So the way we set up an if is we have an if statement If square brackets some test notice a spacing here In this line that spacing is important If you were to have no spacing in there you'd get error and it can also be difficult to troubleshoot that error If if it's simple as just a space you might look at it say it looks good and move on But then we have a then statement. So if something if this is true, this is false Then run some commands and we close out the if statement because notice we don't have any curly brackets or curly braces then we close out the if statement with the reverse so fi We'll notice this again. We look at the case statement. That's just its reverse of that that that selector word. So if in this case closed out closed by fi That's the real example looks like of that So an example loop here would be if dash z dollar sign one So we'll take a look at what that dollar sign or that dash z means a little more in depth but essentially that says if The first parameter is empty. So if I didn't pass a first parameter Then echo out a usage statement So this is very common for a lot of scripts to say I need parameters If I don't get them go ahead and print a message saying I need this this parameter. So if you hear f if dash z dollar sign one So it's a test here and saying the test is is dollar sign one an empty string Did I get parameter? Then then our command echo Use statement dollar sign zero again dollar sign zero being the name of the command Usually here people might put in the name of the command as they know it But at times commands can get alias commands can get sim length and have made a slightly different name than what you intended So using using dollar sign zero here makes a little more Practical a little more approachable to any situation Closing it out with the fi So some of these other test operators that we can use here are again dash z says, hey true if the string is is a Sorry, look at my type out here. Uh dash z is string true if the length of the string is zero Dash a is does a file exist So this is the title here that I will fix But since a is does the string exist and we also have the number of of comparison operators So it's equal not equal less than greater than and if you click on the link here or look for a bash beginner's guide You'll see a list of all the different test conditions we have here All right, so I would see here a dash a file is true if the file exists. Okay And kind of going through here you can see a lot of different examples So again, this resource will have there's a link at the end of the presentation Really great resource to go through and extend your learning or come back from reference Whenever you're writing a script for yourself Okay, so it's a little while loops. So a while loop If we look at a for loop before a loop executes a a series of commands or code for an exact number of times a while loop will Will execute the commands while a certain condition is true So in this case here if we look at our example if we set in a variable to i equal zero And we say wow while The variable i right to zero is less than or less than equal to Can you set it up of four? Do the following command do command one two three et cetera four and we finished up with done so again for our For our four loops and our while loops the Keywords after are do the following and then done. I'm sorry and then done And the difference here is that a while loop will run For as many times that condition is true So a kind of thing to note here is that when You know exactly how many times you want something to run use a for loop if you're unsure How many times you'll want it to run, but you know, it's a certain Test condition you can say I want to run until or I want to run Wow, then use a while loop while loop Like i'm saying that funny I'm taking a look at box breeding script version two So taking a look at some of the things that we just covered and applying them to our version two of our script Box breeding v2 Okay, so this looks a little bit different and we've had a few things that we'll talk about here that can be kind of fun So again, we have our interpreter Been bashing our shebang. We have rounds count Echo So you're also forgot to say that we also talked about functions for a slight bit in this little function might look like When we declare a function and when we call a function within our file So the first thing we're doing here is declaring a function calling a box side, right? So essentially referencing what side we're on Of that breathing if we have a box breathing So while or sorry y equals one so while y is less than or equal to Count so why while y is less than or equal to four due to the following I want you to echo Dash ne and we'll see what this means here. So this line here I'm setting it up so that it's a little bit more visually appealing One of the things I was trying to write these scripts out is that the constant scrolling of the line May not give the best experience. So we'll change that up and we'll see what that looks like In the script. Well, we'll go to each line. We'll teach line here I'll run the script and then we'll come back to the file so we can kind of again see what that looks like so echo dash any dollar sign one again dollar sign one being the So in this case here dollar sign one is local to this function Okay, so this might be a little confusing at time to break it down a little bit I'll add the file and break it down. So Up here. We say rounds equals dollar sign one now These are the parameters that were put into the script from the command line. I'll highlight that when we actually run the command But if we come to the function here This dollar sign one references Down here the parameters we give the function okay so Keep that in mind and I honestly in best practice it might be that in the function we say that um The variable called action equals dollar sign one and then come down here and say action would be So echo the action right inhale hold exhale for a count of y so y being uh actually Yeah, so y being the in this case one and then we're going to sleep for 1.5 seconds in this case here the I'm not doing exactly a count of one second because as as you would do this as you guide yourself through this as you guide Uh, as you look at your screen. It seemed to sort of better flow For the inhales one two three four So I played with that number a little bit feel free to play with that number as well What works for you? Part of this is that you'll have these scripts you can play with them Changed numbers around change the dollars around and since it happens And then coming down here. We have the Incrementing right so y equals y plus one And then done right So then uh see here, okay, so I've been here uh dollar sign one for a count of four okay Actually, I don't think don't think we need that line. I'm gonna go ahead and comment that out I don't think it's going to affect it So coming down into this main section here Okay So we notice here that our function is Here and here right so actually set number So line seven and line 17 is where our Function is so now in this place here This is the main part of our of our script right so main and we're calling it main just for for labeling The comment here doesn't really make a difference But we say as a script to get started up we say x equals one and then while x is less than or equal to rounds rounds being the Rounds passed in passed in from the command line Do the following Now you'll see some new things here t put clear and t put See in biz so these two here What you want to know about them is that it's going to clear our screen Turn our cursor invisible and create more of a blank space for us to have our commands on the screen Now t put is just for a terminal put it's a way to change certain variables or parameters of your terminal if they're available to you You get more information by doing man t put something like that So we echo the round we're on And then we're going to call the function box side here With the parameter of inhale so if we take a look at our function here That dollar sign one Is going to be replaced by inhale if you have a value of inhale And our action here It's going to get printed on this line and we'll see this in action here in a little bit This echo dash n e so this n e's portion that you see here You'll see a couple times here dash n e dash n e slash r Essentially is i'm wanting to write and print on the same line so It's going to clear out the line by doing this here. It's going to clear out the line That inhale and then print hold on that same line Okay, and again, we'll see what this looks like for the script Going the whole script done and then you're done Echo and you're done and then t put c norm so bringing that cursor back to normal Whatever that might be for the the settings so Running box breathing version two and we're going to run it for Uh two rounds. It should be for one round again actually So notice how the screen Cleared itself our cursor is now invisible and we actually have a more animation here, right? So hold for a count of two three four exhale for a count of one two three four um That's part of the hold there And then They'll say you're done script's done So kind of nice if I wanted to maybe Out of more I might say to put c norm and then t put clear Right to kind of clear the whole screen out again if I wanted to So again taking a look here At this Um Highlighting again a couple things that Our box site is called in Multiple times, right, but we only have to type it in for for each In our previous script when we had to if you want to do multiple rounds We have a loop for that here We can actually put all this different code and Have it second away so that we want to change it once within our function or within our Script if we want to change anything right So I could change this to maybe 1.3 seconds or 1.6 seconds If you know what would fit your experience and your maybe your breath work Uh You know, let's actually write this line about needed close it out And again these scripts again are available within the the github repository to play with edit things like that Okay See here Yeah, so again also highlighting this echo dash any one more time But that's going to allow us to kind of get that animation feel Or that the line clearing out and then having it Overwritten close that Okay, so now taking a look at a case statement or Other languages might call it a switch statement and while we while we could nest certain if statements right so if statement then if then um We could do things like that a case statement sometimes make these a little cleaner And so the way we set up a case statement within bash is this following we had the first uh the line so case variable In and we have certain sections so we have these these next sections where we have a specific word Or a number or a regex Right expression that's going to match. So this thing matches So the word matches it's going to have it's going to run the commands And this and is done or denoted that this this code is done by the double semicolons Uh, usually what I'll have is a catch off so star so anything matches Uh, nothing else matches then we'll run some default command You might see this in a Old style init script where you would have the the command name For example, maybe http start stop, etc. Those are usually written in a case statement in bash You have also again here, uh, again, this this code here would be for any kind of uh situation Catch all and then the last line here is essentially case spelled backwards If we look at remember the if statement The way we closed if block was then we typed in fi in this case here. We type in esac Case backwards to close out that case statement So let's take a look at that what that looks like as a whole Right um Let's see here Yeah, so let's take a look at our our script now again for version three which puts some more of these things together So taking a look at the box breathing version three Here we have a bit more and actually for this one Um, I'm going to run the script first to see what it looks like possibly going to be three I might say enter So by possible seat again, we're looking at more of an experience here ready and then we're going to inhale for one two three four hold one two three four exhale for four three two one Notice the the number is counting down in that one and we'll talk about how that we get in the script and hold for one two Three and four. That's it Right and it comes back to like which I have a little more experience around it asking somebody feel do you feel Center do you feel more present? I don't think that kind of noticing those things So let's take a look at what this script looks like uh from What we've learned so far box breathing version three All right, so a couple things here, uh, this looks a little bit more maybe a little more daunting But it's it's really not it's really just adding on a lot of things that we've been working on building up to This point I don't think there's anything in here that we haven't covered as part of this presentation So something you could totally build on your own by just putting together the different blocks and pieces And really it's what scripting or the batch scripting is about it's putting together Little pieces of code or commands to get things done right I'll make some things So I can have some comments here because commenting in your presentation is super helpful Are your presentation? I'm sorry for your script is super helpful And maybe not for anybody else if only just for future you watch out for future you because uh Today you are someone different that you're going to be in the future And that future you may not understand what previously was trying to do or trying to write So comments are helpful Like I said, some people will say they're you know, it's only for me. It's fine, but We changed our our our perception and our concepts change And so having comments and say hey, this is what I was doing is very very helpful. I can't stress it enough So here we have some variables Right, so we have rounds again from our first kind of uh Instance here rounds. We have count, right? So again, we want to increase this or decrease this the number of seconds we hold or inhale exhale for So come here. We have functions our function. I've renamed it to box breath See a little easier for me to do I seem like a little uh Made more sense to me at the time, right? I'm writing this so here we see our first Case tapers switch statement. So case dollar sign one Now remember that dollar sign one within this function is going to be whatever we pass the function It's going to be the primary pass the function and here we see that if If dollar sign one equals exhale read that line if dollar sign one is exhale y equals count And then while y is greater than one. So this is where we're counting down. So y equals four the count four I have to literally point to my screen, but you can't see a screen here the screen capture. So counting was four While y is greater than or equal to one so Uh if my initial portion or when I initially wrote the script is had y is less than One, but really we want to get all the way down to one. So while y is greater or greater than uh one so We're going to count down from four three two one print that out Notice that we're going to again still thinking for 1.5 seconds again This number can change uh depending on how it works best for you and then we have our Decreasing number y equals y minus one. So this gives our countdown effect that you saw on the exhale now Notice in our example, we had catch all so really I only want to count down for exhale So that that code's a little different, but for all other options for inhales for hold Why I can't do the reverse y equals one While y is less than or equal to count again the number of seconds And then we're going to increase that number right so y equals y plus one Okay Notice that for each of those we have the double semicolonist to note that that is the end of that section of that case Closing the whole thing out with case backwards esac. Okay coming down to such Just that normally but come on 28 we see here that that is number seven or line seven line 28 That is the extent of that function Coming down into the main so Here I have some other things to be set up I added in essentially a Pseudo catch all so if I just run the script without any parameters I'm going to manually set a parameter of rounds to one I could have just easily said um Sorry, this if statement here just like an example if dash z so if dollar sign one is empty Then round equals one I could just easily said Echo Dollar sign zero requires one a parameter a round parameter And then maybe said exit One right, so we're doing it for an exit turn code Um, so we just like that. I don't think look what that looks like. I'm gonna do it real quick Save that three See now we see here box reading script requires a rounds parameter, so Come back to our file if I say Again, that's a total choice up to you if you want your script to assume a certain value or to Ask for a certain but maybe I actually asked for a certain value, right? You can do something like that as well so that's a little bit more for a different session like next step I'd be to say With this little parameter ask for the parameter and say hey What should I use for rounds? Okay So now we have here Again, he put clear so we're clearing our screen. We're turning our cursor invisible And then kind of a little more in the experience notion to say We're going to start box breathing. We're going to kind of bring it in for a couple of rounds And then some time between there to kind of get ready find a comfortable seat every feel the floor to do that and then asking asking the user if they're ready before even coming into the whole process of Going through the number of rounds. So in this last one here We have a while loop to do x rounds And then turning into c norm or turn our cursor normal again And that's kind of that's it really that that's kind of taking what we've learned over the last couple of half hour maybe an hour or so And put it together to say this is what our script can look like again All things that in the presentation are building blocks in the script And take a look at that again box breathing version three. I'll say for just one round here For one round here clear the screen find comfortable seat Put your feet down on the floor And again, this could be whatever you'd like it to say right the idea maybe take this and again build it to your to your own specs hold And hopefully if this proves to be useful you put it in your own path, right? So at the end of all this We could say well, I really like version three or running my own version I might say that I can copy or actually because That's how they'll just I'll copy box breathing version three two root bin box breath Our box breathing that And now I can do some like box breathing To one round And there we go see so I'll cancel this out. What I did here was that by placing Version three into a root bin Now this uh, this script is available to me anywhere on mat. I don't need to be in my scripts directory I could be maybe in a root right here and do box breathing. It's available to me there I think I have a few other scripts in there as well, but by placing it in that path It becomes more available to me And we could do that to set it up for any user, right? So If we could do in maybe user bin Or user local bin there's a path that most users have So you can install this for every user in the system And whenever they need a little bit time to step away They can execute the script and have that label to them. It's a nice little touch Okay now Going a little further here in debugging. So we've got to this point when we've written a script and The idea here that you're going to go out further and write more scripts write your own scripts Get a little more dicey with the things you're going to use And maybe not have everything laid out for you ahead of time Or you're curious about what's going on in the script So there are a couple ways we could go ahead and debug a script and we'll show some of those right now So a couple options we have we could do a dash x we could execute bash Dash x and then a script name And then that will turn on Essentially tracing the commands and what that means is pay before one's commands It's going to give you an output of what's going on So you can see maybe variables and that and then Dash v would be for things things get read into the file. So let's see what that looks like here Oh, actually There's my box reading script v3. So take a look here. Let's go over to home directory and we'll say We'll say bash dash x test script Okay, actually bash dash x test script Okay, so I'm doing the dot slash because I'll make sure that I'm executing the The script in this directory. Okay So notice here these lines. So these lines here are the ones that end up being What's executed? So you see the plus sign echo my bar echo my bar 2 etc Can idea of what's happening if we want it to get a little more Uh As timer and then with the scripts Let's take a look. We'll we'll do the first one here the bash dash x and we'll say box breathing in version one Let's put in a rounds there And now you can see what's actually happening. So you see here that the rounds were set to one count was at the four We echo our first line here and we see the resulting echo of that line And then we begin to happen again. You see the What's happening in the script as the script gets run? Again, which can be very useful If we did maybe a I know what's happening. Actually t put c norm There we go. I think one of my scripts didn't have at the end. Let's see here What does okay? No I can type in t put c norm got my cursor back here, but let's take a look at this Let's add in x v So we get a bit more of that output So again, if you wanted to turn to all the output way up you could do dash xv and see what's going on with that What's coming in and what's going out? Another way we could do debug some scripts is that Vi let's do let's do box breathing Three that's a little bit. I at the very beginning I could say dash xv here or I could say set dash x to to turn the debugging on And set plus x to turn debugging off Okay, so let's take a look take a look at that here Maybe over here We'll say that again, these just an eds real quick As an example echo turn debugging on set dash x and then After the second hold We'll say turn debugging off and we'll do a plus x Okay, and this is gonna it's not gonna look pretty at first But we'll see what happens here box breathing version three which Pros do for one second one round And we'll see here the output. Yeah, so we see the output of what's going on that loop Let me see here at the end turn debugging off And then notice that after that there's output so much So again, we that's a way we can turn debugging on turn debugging off and it's really more helpful than Trying to look at a script and coming down here and Something we might all be doing sometimes is say, maybe I'll say Echo X right so I kind of get a checkpoint in that script Kind of default way a debug just print out variables wherever you think they're getting changed or getting become something that you don't want them to be But again doing a dash x or a plus x can really be helpful to turn on or off So a couple resources for everything that We've been working on here. The first one is the get repository Where again, I'll have all the scripts that you see here. I'll add more to The content as the presentation grows as it gets bigger Or like a feedback right any feedback y'all have would be amazing to have to receive update the slides of the scripts and Turn something that's going to be be useful for for a lot of people. Hopefully Bash online so let's take quick search with a number of places online that will have some sort of playground or Sandbox and so in this case here we're looking at tutorials point.com If I wanted to execute this I might say execute I'm looking inside. We have our bash script over here. We have our Hello world if I come back to look at our Bash, if I just cap that out real quick I'll copy and paste this into this is as an example and then execute We'll see here Yeah, it's kind of nice each one play with things Maybe test the thing out We don't want to hop on to a terminal. You can have this name bookmarked or something like that and Then the the last resources here is the thing that again this presentation is Curated from a lot of different resources, but a really good resource for For both beginning and advanced people it's going to be these two resources the bash guide for beginners From the linux documentation project and then the advanced bash scripting guide And so this presentation is a combination of topics from both beginners and the advanced so A lot more information there you can see here Okay, now we have our script. Let's go ahead and work through a few more rounds of box breathing And in this case here, I'll let the script do the queuing Instead of just me so box breathing I'll do it for three more rounds again The idea here is after we've written the script It's available to us when we need to step away for a moment or Just take a take a literally just take a breath, right? A lot of times when we're tackling a project or a problem and it seems like we're hitting a wall stepping away Doing something different in this case. Maybe taking some time for a bit of breath work can really Change that perspective and open our eyes to new solutions. So We'll close this out here With a bit more of box breathing again Uh, if you want to close your eyes and count your head perfectly fine Uh, it works just as well. Or if you want to try this script out, maybe you've been playing along with it or following along Uh, feel free to do that as well. So I'm going to let this go for three rounds here In box breathing and I invite you to to do the practice with us, right? So Sorry box box breathing for for three rounds here. I'm finding a comfortable seat I'm ready I'm inhaling That's it Hopefully you feel a bit more present a bit more Grounded and ready for whatever next presentation is up on your schedule Closing this out here Uh, talk to me if you have questions suggestions feedback, right? So this is prerecorded We're gonna have a live Q&A after this. I'll be available to answer any questions If you're if it's past the original presentation feel free to email me Alex that what is at rackspace.com? That is my employer that I'm principal engineer with our Linux Linux systems support teams or listens Yeah, Linux systems engineers Uh, find me on twitter that mr. Alex waters if you can reach out there And if you're wherever you're watching this reach out, let me know what you think Uh, I get any feedback is Greatly appreciated. It's the only way we get better as we we learn from doing teaching and getting feedback on that so Thank you all very much. You know, it's been a pleasure for recording this and I hope you all find it Uh helpful Thank you. What's going on. So thank you Uh for being on the presentation. I know that there were a lot of issues with the Uh recording as far as resolution goes and I've talked to the team here at the opal summit And we're going to try to get you a better resolution Uh video up on for to watch on demand So I wanted to go ahead and go through a few of the questions that we have here still I tried to Answer as many of them as I could during the presentation. It was kind of nice to kind of do it while The video was running One question that I got here a couple times was What is set used for and in the presentation I said I used it as to Turn on debugging or turn off debugging for the set x or a set Plus x and and really what that does is that Set as a whole allows us to change shell very well to show options Read here Okay The repo link I posted into the chat As well as part of the slides So here I'm going through a few more of them here Okay, the question here when using sequence in the for loop does it generate the list of numbers before All iterations or does it find the next number at the end of the each iteration? Right, so it's good the command itself generates that list of of numbers so That will get loaded into the the loop itself so Looking at the context of the question It would generate that list before all iterations So the sequence would get generated and then that would get that would be fed into the loop for those iterations So we have a question here. Why does let i plus plus Pipe echo return nothing Because so if when we look at a pipe, right so a pipe connects the standard Output of a command to standard in of a command And what we see here is let let might not have anything Going to standard out, right if you were to type in let i plus plus on the command line or in a script By default nothing's coming out of that command, right? You would use echo to see what the current value is But by default using let i plus plus doesn't send anything to standard out So nothing gets sent into the standard in Of echo right you would use a echo dollar sign i to to display the contents of Of that value right of i variable Oh, nice. So there's a comment here. I really enjoyed this. I've been writing scripts since 1989 You know about the sequence command. Yeah, that's one of the benefits. I was like doing these what may seem like Fundamental topics is that I feel like for For people who have been doing it for a long time some new things may be introduced So that maybe you get a bit more value as well, right? Even though you've been doing it for a long time So I really like doing these these foundational fundamental topics for specifically that reason I've heard Very similar comments for other presentations where somebody's been doing this for for many many years and one thing I showed them Changed the way they started to write scripts after that Looks like we're good Again, thank you all very very much. I do appreciate Your patience with the screen and the presentation Except we're going to get a better version out there any other questions or anything you have Please feel free to reach out to me The presentation or the slide deck has my contact information Happy to hear from any and all of you. So thank you all very very much


with some more of Queensland's day on why in the morning my name is by Moses or it's by one social media. So remember, you can you can interact with us as well on the family social media platforms which are always right there below the screen. The place to focus on today is Facebook and Twitter. Our Facebook is Y254. Our Twitter is Y254 channel. And the question we are asking today, what are some of the extremes people go during or after breakups in terms of reaction. And we have a picture there that is self-explanatory. I'd like to sample some of the comments that you have sent away. So, if those were my credentials, then I'll quote for my day. Wow. Okay, about the topic, I think it's all about mature thoughts. Thank you very much for that one. And then we have lucky boy Kip Chumba Nase Mahi and Lucky Kip Chumba from Eldred. When I break up now to then I'll come text Keshwa Nakulizatini Nani. I love this a thing very much for that one. Felix when I say, I can't waste half of my life looking for papers for you to tear them and work scot-free. I don't know what I will do to you but I'm sure I will do it. So the picture has caused a lot of, it has provoked a lot of thinking and a lot of comments right here. Sydney's kid came here and said, after sorting everything out, just in peace. I've never seen men do this kind of stuff. So it's time to insinuate that it must be a woman who did this thing that we have in La Beja right there. If you're not getting what we're talking about, head straight to our Facebook page. That is at white by four. You'll see a pin right there. The question is there and a picture to guide you towards what we are saying. Fidel the baby from Kasabuni and said, the worst case scenario ever, when you're going to do after breakups. Always remember, it's okay. Someone was in and I said, are you going to sample it? And then if it's clean, definitely we're going to play it. I don't force.  All right. Which is a very, which is something I've seen. All right. Always watching one in the morning. And I say that no one should admit that they can't kill. Wow. That is a deep word right there. Thank you very much for taking your time to comment. And we appreciate everybody who takes their time to interact with us on our Facebook page right there. Keep them coming. If you have any story to share with us, we'll really appreciate it. On to our first interview of the day now. And this brother right here, his name is Tony Momo and is a young entrepreneur and is the CEO and founder of Mark Me. And now they have a new product in the market that is here to share with us. Mr. Tony. Thank you for the chance to talk. All right. Your camera is number four right there. Just introduce yourself in case I forgot something. You can add it to political credentials. So my name is Tony Momo. I'm an entrepreneur. I'm the founder and CEO of Mark Me. So we recently launched an e-learning product as we are attempting to rebrand what you are doing and to create more value for people. So the e-learning product is called Shuffle Learn. And I'm really thankful to get the chance to showcase it and show how good it is and the value that it can add to people. All right. So Shuffle Learn is the latest product that you have right here. Yes. And I'm loving it. I'm already on the website right here. And at home I see we have a number of things. We have a number of buttons that we can click right here. There's home. There's land. There's shuffle talk. There's SL store. And then there's about. So when I click here at about, I can learn everything about Shuffle Learn. But I'd like to get you from you. Yes. Why the name Shuffle Learn first? So Shuffle Learn is based on the identity of the product. So it's a card based e-learning platform where you get to shuffle through cards in order to learn. So it's a very simplified method of learning. We don't give you a lot of articles or a lot of paragraphs to read. It's very fun and engaging. And as you are shuffling through the cards, I thought that would be a really good name to give the product its identity. So the name Shuffle Learn is based on what you are doing on the website which is learning by shuffling cards. So it's just as simple as that. So the whole concept is learning from shuffling cards. Yes. So you have key pointers that you can read as you shuffle them cards. Yes. Yes. All right. I hope we can get the website on screen right here because I have it right here. So when did you come up with this idea? Being your background is mass communication. Yes. Yes. Yes. So my background is in film. That's what I studied. I studied film because I started with YouTube. That was my first outlet for my creativity. But I wasn't truly satisfied with film and video. I didn't feel like it's the threshold or it's the limit of what I can create. So I started learning HTML through a site called Codecademy. I also learned to use developer tools through sites like Wix. And combining that knowledge is how we were able to come up with the idea for Shuffle Learn. But I also love e-learning products and I haven't found... So you are a product of e-learning because Codecademy is an online learning platform. Yes. Yes. That's how you learn to code. Yes. So you figured, oh, since I can learn like this, I can also help other people to learn in the 254 and worldwide. Yes. All right. So Mark me, how many people do you have at Mark me as the people that you work with? I currently have a team of five people. So all of them are my close friends. Two of them we met in primary school. That is way, way back. Way back. Yes. So three of them I met them in Kenya Institute of Mass Communication. So they are a really talented group of people and we wouldn't be able to have that product without their ideas, their output. Shout out to everyone at Mark me for helping with what you are doing. I mentioned names. Just five names. To Tony Bryan, to Dickens Kingory, Brigad, Cedric and Kate, thank you for your efforts to build Shuffle Learn and Mark me. All right. Kate is the only lady in the group. Yes. Yes. So you have not reached the two thirds, the one-third gender group. Yes. Yes. Yes. All right. I hope you reached the one-third gender group right now. But anyway, so we have the Shuffle Talk here. Yes. It's called Shuffle Learn. Yes. But we have a button here. Shuffle Talk. Let me click on it. Tell me more about the Shuffle Talk. What happens at Shuffle Talk? So the basis of the product is to allow people to create and access topics as well. So I can join Shuffle Learn as a topic creator. If what I do is photography, I can join as a photography topic creator and create those topics. So the essence of Shuffle Talk is to allow a direct line of communication publicly between the topic creators and the learners. All right. So I can do my research. I have a document on something I researched and put it on Shuffle Talk and then engage other people in the same field on this particular topic that I did my research on. Yes. Yes. Okay. That is amazing right there. Yes. Okay. So what are some of the fields that people can study in here at Shuffle Learn as we speak? So as we started Shuffle Learn, we wanted to base the first round of topics around four categories that would capture people. So from the research that we did, the best categories to start with our business, well-being, content creation, and planning. So those are currently the four topics, categories that are available. Things that are affecting this generation right now. Yes. Yes. Yes. People are obsessed with content creation. People want to create content and upload. Yes. It's a source of income as well. Yes. Well-being is a major issue right now. Yes. We have a lot of mental, I don't want to call them illnesses, mental health issues. We have a lot of mental health issues as well. And then we have photography. Photography is buzzing right now. Everybody has a camera. Everybody with a smartphone has a camera. Yeah. So these are some of the things that you're helping people to learn right here. Yes. All right. When it comes to the original content that you have here, how do you manage to line since then? Or is it original content created by people from Shuffle Learn? As a team, we come up with our own topics so that we wanted to start with first providing content as Shuffle Learn team. So in terms of licensing, we don't plagiarize content. It's our own. So we research and then we come up with our own content. But as for topic creators, there are terms. Yes. There are terms and conditions. So like what you post on Shuffle Learn, you own it. We don't own what you come to post on our platform. Yes. You have the rights. If you want us to take it down, you can just contact us easily and we will do that. But in terms of licensing, we haven't reached that point of topics. All right. My content from other people. Yes. So it's an open field. You have your own content as Shuffle Learn and then it's open for the, what did you call them? Topic creators. Topic creators. You have room for the topic creators to come upload their stuff and people can have conversations around them. Yes. Wonderful right there. So I see it's an amazing site. Even the look, the interface right there. Shuffle Learn is a new learning platform that believes in innovating learning by creating a fun, unique and engaging learning system. Explore Shuffle Fun of the day and learn about it. Simply click what not and what not and what not. All right. So there's so many aspects that go into this. We have the coding, the backend coding. We have creating the user interface, the graphics. We have the legal aspect that you were telling me about. We have the corporate aspect. Who does all these things? Everybody has specialized among the five people that you told me about. Yes, everyone plays a role in making it, but currently I'm the one handling the development side of the website. So in terms of user interface, I wanted to build something that would be easy to use because I think even for me as the first user as I am building it, if it doesn't satisfy my need for user friendliness, then I'll feel there's something wrong with the product, but we built it to be very simple. And as you can see from the homepage, we're telling you to simply click left or right. From that simple exercise, you have mastered what the platform is about. Simply click left or right to shuffle and learn. And I like the transition. Yes, yes, yes. So yes, in terms of the, I think you asked about the corporate and yes, different aspects. I just want to know if one person does all these things or people have specialized? I do the content. I do the developing. So my team handles the content in terms of like we have topics about long-term planning, personal development planning. So I delegate those tasks to them to create the topics. We have a little designer called Ndwiga. So he came up with the logo and the branding of the, which I love so much. Yes, yes, he's a brilliant, brilliant designer. The SL is subtle, but you consider? Yes, yes, he's a brilliant designer. So he handles the design of the cards as well. For the shuffle cards, as you can see, they have a design. So that is also Ndwiga's work. In terms of the photos that we have at Onimbrayan. So he does the photo decisions in terms of what matches the topic. And what goes on, what doesn't go on? Yes, yes, yes. And then you oversee the whole thing. Yes. You oversee the whole thing. Yes. All right. So as CEO, what are some of the challenges that you have faced as a starter in the 254? I think definitely the first challenge is financing. You know, shuffle and is a product that needs major investment in order to actually get somewhere. Yes. You also need a lot of marketing costs. So the first major problem is financing. But that doesn't hinder us from putting a product out there. But I believe in divine connections. I believe there's always someone who will see what you're doing and they will believe in it enough to help you. Share the vision. Yes. Yes. So that is currently something that we need right now. If there's any investor or partner who will be willing to help. If you're looking out to call investors, just look them straight into their eyes and talk to them, the potential investors. On camera 4? Yes, on camera 4. Hello. If you are an investor or or an angel investor or a partner who can help us with seed capital to further push our product, we would be very interested in talking to you. You can talk to us at markmeas page or you can send us an email. My email address is iatonymumo at gmail.com. So if you'd like to join us and be a part of our team, we would be very much willing to have you to take Shuffleland to where it's supposed to be. All right. Thank you very much for that one. So the innovation space in Kenya right now. Are you interacting with other innovators? Yes, in terms of my I think my close circle of friends to see what they are coming up with, especially people who are also doing things with websites and programming and that coding and that's something that really interests me. And I would love to add on no people who can do AI coding that is really advanced because that is the future for me. Yes, if you could have such technology in the website that learns what topics you like in order to just suggest to the right so those are those are some of the things you're going to be focusing in the future at Shuffleland right here. All right. We have had a pandemic the last seven months I think and people have learnt new things that they didn't even know existed. How has corona affected you as somebody in the startup space? I think the first thing I can say is first of all mark me in order to get to where we are we were surviving on small opportunities like photo shoots or maybe doing a video for a salon. So such small opportunities really became hard to come by which is what we were basically surviving. That is where you're getting the funds to plant here. All right. So it was a little bit harder to get the funds to invest on this other side. Yes. All right. But what are some of the things you have learned from the seven months that we have had the pandemic as well? What are some of the major things you have left the pandemic with in terms of lessons? I think the first thing is how you utilize your time. Now during quarantine I think a lot of people had time on their hands. So for me I also learnt how to do 3D modeling. I've started to do that in order to also increase the value that I add to the company. So I've also learnt in terms of patience. Things don't just happen when you want them to happen. The third thing I learnt is about much giving up because you see in a position where we are struggling to get small opportunities and here we are trying to launch this big thing that we don't have. Small opportunities to grow it. Yes. So I think also learning how to not look at your situation in terms of I can't go for this bigger thing because of why I'm out right now or because of what is happening around me. So I've really learnt to just take the risk if you believe in what you are doing because Shuffleland for us was a risk and I think I learnt that even if the situation around you doesn't fit into your dreams or fit into what you would like, still go ahead and be bold with what you are doing. I'd like to talk about the last version that I'm clicking here today. We have the Shuffleland store. What is the idea behind this? And I see somebody with a cut right there. What is this shop about? This is a school with a shop. Tell me if I said it. It's kind of genius too. So that is because so personally we care about our topic creators and we would like them to be able to earn money from being a topic creator on Shuffleland. So the thing with the Shuffleland store, so that's just the short form SL store. So we want to once we, so currently we've set a goal of 5000 topic creators. So once we reach that number we can have enough people to kick start the store. So if I'm a topic creator and I focus on photography and I have an e-book or I have yes pictures, calendars, yes calendars you can now sell what you are doing on the Shuffleland store and earn some money from being a topic creator on the website. So that is also in terms of the product I didn't value to people. So that is something that is really key and I think it would be really good in terms of the business model of the product as well. It works for us and it works for the topic creator. It puts the money in the pockets of the topic creators right there. Yes, yes. All right wonderful. This is an amazing idea right here and I love the site. We also have the dark and the dark mode and the light mode. Yes. All right. Why is this so important? Because I see it, I think on the first page that I clicked right here. So I think right now our technology and apps and websites are, if you find a website that doesn't give you the dark mode option, it seems like it's not in the current, in the current time like it's left behind. Yes, yes, yes, yes. Personally, I think for major websites I use dark mode personally like it. So I thought in terms of giving the product a lot of relevance in the online world, in the innovative world. So something as simple as giving a user the options for light mode and dark mode would give Shuffleland an image of a product that is aware of the time zone that it is in. Edge right there. Yes. I can use it in the outdoors, palivo, light mode. All right. I like, I like that. Okay. So as we wrap up, please give them your social media handles. But before you give them your social media handles as a self-taught coder, what is the, what is the importance of having information online? Like this information that you're trying to provide to the photographers and the content creators for wellbeing. What is that importance of being able to Google something that you're looking for and find it, either on Shuffleland or Code Academy or whatever site? What is that importance? I think the importance is implementation. I think it's not just about what you learn online, it's about how you implement it. So I think in terms of the information that is out there, there's a lot of information and I think what differentiates the people who consume it or the people who truly benefit from it are the people who learn how to implement it. So I think implementation is very important in terms of your learning. But always remember how are you going to implement it? Yes, yes. That is the most important question you can ask yourself. Yes, yes. Social media handles and tell investors to come rock with you guys. Okay, so on camera three. Yeah, on camera four. Okay. My social media handle is Tony Mumo. I have a page for our company. It's mark me on Facebook. On Instagram it's mark me IG. You can find us on those platforms on Facebook and mark me and you can talk to us. You can see what you're doing. You can join Shuffleland if you are interested. And if you'd like to invest in us, I would like to have you. And Shuffleland is a product that also has global potential. We've marketed it online in India, in Egypt, Ethiopia and we've gotten a lot of positive feedback. So it's a product that has global relevance as well. And we'd like to have someone who shares that vision with us. Thank you very much, Mr Tony. And all the best to mark me, all the best to Shuffleland. Keep doing what you're doing. We appreciate you so much. Thank you. All right, we have come to the end of our first interview of the day on this particular Queens Wednesday. As we celebrate the Queens, remember we are on Facebook at Y254, Twitter at Y254 channel. And we have a question about breakups right there. So check it out. I will be sampling them towards the end of the show. But right up next we are having a conversation on the same. So don't go nowhere. Don't take that down.


Welcome to All Hands Update, here's what's happening around your Navy. The Navy announced that all primary objectives for I-6 2016 have been met and the breakdown of Ice Camp Sargo is underway. The Arctic exercise wrapped up 7 days early due to a crack in the ice that caused a safety hazard. 40 Navy athletes enrolled in the Wounded Warrior Safe Harbor program have been chosen to represent Team Navy at the Department of Defense 2016 Warrior Games this summer. The athletes were evaluated during the Wounded Warrior Pacific Navy trials which took place February 20th through 26th in Hawaii. During the trials, 54 athletes competed in 7 sporting events including swimming, track and field, wheelchair basketball, sitting volleyball, shooting, archery and cycling. The Navy is recognizing the very best sailors across the fleet as sailors of the year. Reach out to these sailors and congratulate them on a job well done. You can read more about what's happening around your Navy at NavyDalmille.