Watch along to captain Miller Which is a very white name. Yeah, which maybe it's from the British who knows? Miller is a very white Courtney Miller what was weird as I had I don't know why we haven't yet seen in this film anything about the Miller brewing company I was expecting this to be about beer true If you saw some YouTube you seeing a very cut a version to like see full-on cut version You can have a patreon up in the link description below with the pin comment so you can go check that yeah, yeah Let's get back into this, huh? Oh You What if we take that throne as our own? We will leave that throne with that Kharidhupuri family and Singham. For one of us, the family will be ours. The most powerful empire on the face of the earth has amassed unimaginable wealth, taking what it deserves. I expect our king will be rather pleased with this fascinating little trinket.  The governor's son. Governor's son. Riley. Yes. Girl, ask one thing. I give her. Yes, of course. You must. Whatever she desires. Oh, Saab. We are doing this for the country. We can't do anything right for this country. Look. I have kept all the front lines in front of me.  General, it's actually stone then. The village and the temple will now become British property. Mining will soon begin and we will find out exactly what lies beneath. Kill one of you. Every hour. Until someone tells me where he is.  Come to the north at one o'clock. Thotasat. This is Thotasat. It's a good morning, brother. My friends have been hit. There must be another way to stop your shooting. You all...   Listen, you tell me.  He told me to go to Silvan to get the money. He will only go to Dhanushkodi. If he goes there, we can kill him. For hundreds of years, that stone and this temple were not respected. But they have made sure that our people do not go to the temple today. Brother, where did you come from? Did I come? Are you fine, brother? I am fine, mother. You are fine. I am fine. Give me auntie. Okay, brother. He has changed the town by telling me not to get scared. You have forgotten your home and are wandering around the town. He has grown up, right? He will be like that today. That is what I know. Mother, in the old days, four people told him to believe in him. Why are you breaking that belief? I am not breaking it. Come, let's go. I will tell you. Come. The guy who is looking for the foreigner is the guy from the town. He has come to the temple to get the money. I told him to come here. I have sent my men with me. We will see how the temple will be built. I have told the girl. The people are related to each other. That day, when Raja's men came to see you, he came to the temple to get the money. He said he knew you. Now, the town will be destroyed by you. When the guy who was looking for the temple ran away with the money, he wanted to escape without fear of death. He is the one. I don't know what happened to him. I saw this in Isha. Go. And if you don't, General Wandy will return with a huge fleet of 700 men. And you feel the animals won't stand a chance. Where is he from? England, Scotland. Surrender. I herself. Now. And you will call me Captain Miller. What are you going to do? I didn't listen to you. If Isha wants to surrender, I will come to you to stop Isha. Do you know what Captain Murphy said about you? You were the first one to threaten them and go out bravely. You didn't go out with the animals to protect them. I will go. They can't trust me.  There is a secret behind the temple. I can open it if I go in it. But the people in front of me have to find the evidence. You were the one who killed my husband. I didn't believe he was the one who killed you. You have to do something about it. What? It happened because of my money. You can go to the temple.


QuickBooks Desktop 2023. Purchase order adding new items. Let's do it within 2-its QuickBooks Desktop 2023. Support Accounting Instruction by clicking the link below giving you a free month membership to all of the content on our website broken out by category further broken out by course. Each course then organized in a logical reasonable fashion making it much more easy to find what you need than can be done on a YouTube page. We also include added resources such as Excel practice problems, PDF files and more like QuickBooks backup files when applicable. So once again click the link below for a free month membership to our website and all the content on it. Here we are in QuickBooks Desktop. Get great guitars, practice file. We started up in a prior presentation going through the setup process. We do every time maximize in the home page to the gray area noting in the view dropdown. We got the hide icon bar and open windows list checked off open windows open on the left hand side. We're not going to be opening up the reports because this time we're going to be entering a purchase order which as we saw in the first month of data input has no impact on the financial statements. So quick recap of the purchase order we're dealing with inventory here. Remember that when dealing with inventory you might have a periodic inventory system or a perpetual inventory system. If you have a periodic inventory system you might be tracking inventory outside of QuickBooks on something like Excel and then adjusting it periodically at the end of the night, week or month. If you have a perpetual inventory system return on the inventory in QuickBooks which will be indicated by this line item up top. It's found in the edit dropdown preferences. We turned on the inventory by going to the inventory items here items in inventory and then turning on inventory which will show us this top line item. And then also note that the purchase order might not always be used if you're in a situation for example which is similar to a situation when you buy stuff personally online from like Amazon. Then you pay for the stuff before you get the stuff. In that case you would have a financial transaction but if you're able to have more influence and able to request the stuff with a purchase order without paying for it. They ship it to you and then you enter the bill once received. That's when you would be using the purchase order. That's what we are imagining here. We're going to enter the purchase order. We're going to add a new item, a new vendor and new customer all as we do the purchase order. So we'll go into it here. The new vendor is going to be Fender. So we're imagining that a customer comes into us and says I want this Fender guitar. We're going to say we've never dealt with Fender before. Maybe we can add them as a new vendor. So we're going to go through that request process. So we got a customer that came in and we're going to go to the new vendor for them to get the guitar they want. So Fender is the new vendor. I'm just going to keep saying that because it sounds cool. Fender is the new vendor. We're going to do a quick add with them. Do a quick add with the new vendor and then we'll tap through this. We don't have any. Let's go with the date. What's the date? The date's going to be let's say it's 2 9 23 0 2 0 9 23 on the date. Number looks good. Vendor shipping to OK. Now we need a new item down here because we never bought a guitar from the new vendor Fender. You'll recall that we normally set up our items in the lists and items here. But we're not going to do it that way. We're just going to do it as on the fly as we go as they say hit the drop down. We're going to say new item. It's going to be an inventory item. So that's what we want. I'm just going to call it an SG tab tab tab and I'm going to call it a squire. That's a kind of a guitar. I think I don't know. So squire we're going to say we bought it. We're just making this up 168. You can I'm not saying this is the actual price or anything of these guitars. And this is the preferred vendor is going to be Fender. And then when we sell it this is what's going to be populating on the sales forms. Notice we are on the purchase side. Therefore we're going to be having the cost being used to populate when we get to the sales side with an invoice or sales receipt. That's when this side will populate at the 244 we're going to say it is subject to tax. That means sales tax. And the account we want is to go to the sales account an income account when we create an invoice or sales receipt. The inventory account will also be impacted on the purchasing side when we buy it not with a purchase order but with the bill or check. And then it'll go down when we sell it with an invoice or sales receipt. We don't have anything on hand at this point. I'll just keep the current date that this is as of the date that we're entering. And I'll just keep that there. So we'll say OK. And there's our squire guitar. So how many do we want. We're going to say let's say 20. I'm going to say 20 of them. So and then I bought them specifically for the customer of new music stuff. So I'm going to add the customer once again as we go on the fly as we're doing the data input tab quick add I'm just going to do a quick add for new music stuff. So the scenario new music stuff a customer came to us asking for 20 squire guitars which are usually given or provided by the the vendor the vendor. We didn't have Fender the vendor before we set them up. So we then went to the vendor Fender asking them with this purchase order. That's what this is doing for these 20 guitars note that Fender the new vendor doesn't need to know about the customer here. But we want to add the customer to the purchase order so that when we go through the process when we get the guitars we can turn around and make an invoice and build the client and customer for it. Now what's this going to do when we record it. Nothing because we didn't pay for the guitars and we didn't receive the guitars yet. But we do want to track it so that when we do get the guitars we could tie it out to the purchase order. So let's say save it and close it. And then we expect in the future notice in this list in the items list we now got the squire here set up. If I go to the homepage in the future we're going to receive. Imagine we're going to receive the guitars and then there's going to be a bill in the guitars in the box of the guitars. Remember that the bill that we get in the box of guitars might say invoice because if they're using QuickBooks if Fender our vendor is using QuickBooks they would have created an invoice. In order to give us the bill. So note that the forms within the accounting system are a little bit different than the actual terms that you might use in real life. Meaning if they sent us the guitars with a bill in it it doesn't necessarily mean that I'm going to enter that into the system with a bill form. Because as we saw in week one or month one we could just write a check for it right we could take their bill and just pay it off when we get it. So the bill the bill that we get from them this time however we will enter as an invoice or bill when we get it and will populate that bill with the purchase order. So we can see that here if I was to type in Fender the new vendor I've got this connection to the purchase order we can create the purchase order in essence or create the bill in essence from the purchase order. I'm going to say no not yet we'll do that later close this out and if we wanted to track the purchase order we could do that by going to the vendor center here or we can go to the vendor center up draw up top which is what I typically like to do. And then I could go into my vendor side of things we're looking for the new vendor Fender. And if I look at all transactions and all transactions here there's the purchase order. And then I could also sort my purchase orders by going to the transactions tab purchase order. And then I could see all purchase orders or possibly just the open purchase orders. There's the open purchase order if I go into that there's our purchase order. So in future presentations will hopefully receive the guitars and again no change to the reports so we're not going to go to the reports and kind of review it. We're just going to be tracking that purchase order which will come into play in the future.


Introducing the 2GIG key2e-345 encrypted wireless 4-button key fob. Utilizing encrypted protocol for enhanced security, this device will operate on the 345 MHz frequency. A 4-button design lends for arming away, arming stay, disarming, and panic commands. With a small size of only 1.23 inches by 2.26 inches by 0.45 inches. This device has incredible range with 350 feet line of sight open air range. This device operates at temps between 32 degrees to 120 degrees Fahrenheit making it extremely durable. Ladies and gentlemen, introducing the key2e-345 from 2GIG. Make sure to subscribe to our YouTube page and click the Show More tab underneath the video where you can view valuable links pertaining to this product, similar how-to videos, and our low cost, no contract alarm monitoring services.


What is what is this? What is that? What does that question mean? Well you many different answers. Well, what does it show us? Well first it shows us student at Netlab 24 Tilda dollar, and I think you've been typing commands. You may have seen it change sometimes What does it information does it show us student is the username? I'm logged in as student At Netlab 24 is the host name the name of my computer. I'm actually logged into the computer at the back Yours would be Netlab one two or whatever the computer number is So that's the name of the computer Call on the Tilda represents your current directory Tilda remember here is your home directory slash home slash student. This is just a shortcut and Dollar means from now on everything beyond that you type. This is called the prompt Okay, and the prompt in this case can provide some useful information who I am What computer I'm on? What directory I'm in? Why do we care who I am? I could log in as someone else. I can actually I don't know if you can but I can switch to Instructor I Need the password you could probably guess it Now I'm logged in as instructor on this computer and now it shows me I'm instructor so that's useful information in that it Reminds us who we're logged in as This reminds us what we're computer. We're on you've already used secure shell to log into other computers at the start to run This max to view my terminal sometimes you forget you run a command You think you're doing it on your computer, but you're actually logged into another computer So this is a little bit of a reminder which computer are you logged into and? This is a reminder of where you currently are your path This is called the prompt and what we type beyond the dollar sign is what is executed It's log out of Instructor. We can change the prompt very quickly First The things that we're going to do Most of the commands that I've that we're going to demonstrate are on one of these two web pages And these are linked to from the Moodle workshop You go to the workshop the resources there's A list as prompts and scripting and W get PDFTK and so on those two websites I list most of the commands were about to do this afternoon, so It may be useful now to open the website and you may better even follow along there We will not do all of them. So this one on aliases prompts and scripting Has some information about manual pages man pages. We will not do that now. Have a read-through in your own time Then it has something on There's some more new information there aliases we may not do that at all We'll scroll down a lot Shell prompt okay, so the things I'm about to type some of them Most of them are on this website. So you have your own reference for later Echo we saw towards the end this morning that echo displays something on the screen What something the the the parameter echo. Hello prints. Hello on the screen, but in the shell Right, what is the shell when I say the shell? The language that this terminal Interprets we refer to as the shell So The commands that we have here And the the way it outputs things the shell is the piece of software that that manages all of this In there are different shell Programs the one we're using is called bash B. A. S. H. Born again shell, but there are others now The shell is like a language. It's almost like a programming language. We'll see some constructs later But we can have variables think of of them environment variables in Windows you may have set the path the path is an environment variable We can do the same thing in In Linux and other Unix operating systems So echo. Hello prints the string. Hello, we can create a variable Whatever I like to call it like this and we can echo The contents of that variable This is not about the prompt. This is just something about the shell. I can create a variable ABC By assigning it to some value in this case a string Steve and I can display or I can Refer to the value of that using dollar followed by the variable name We'll use them as we go through some examples a variable Sometimes we enclose the variable with Sort of the the full ways to enclose it with curly braces the same thing dollar followed by the variable name or dollar in Closed in curly braces the variable name Just two different syntax so There are some variables which are defined in the shell already. I just defined ABC and I can define others But there are some already in but already defined environment variables one of them is the format of the prompt and It's called ps1. So the variable name that defines the format of the prompt is ps1 some strange string Echo dollar ps1 some strange string Forget about this Debian ch root and so on Again, we don't have time to cover everything look at the last few characters It tells us the format at which the prompt should be printed on my screen and I've known I started before that Slash you means display the username at Slash h means display the host name the computer name colon slash W's display the working directory and Then slash dollar means show an actual dollar sign because it's a special character So these characters define how the prompt is displayed We can change them ps1 equal to I'll put it in quotes You can change it to whatever you like You can define it as just a string or you can use these special characters to get particular values So ps1 is just a variable which defines the structure of the prompt If you look through the man pages, you'll see the definitions of these special characters and many others That's not what I'm doing today. You can Find them in your own time. That's just a quick explanation of the prompt and let's change to maybe Something different. We need a dollar. I think we should do dash Okay, so change the prompt to whatever you like in this case. I've changed it to just display the username Followed by a dollar sign space and then what I type in That's the prompt in the website. There are a few more examples of the prompt which will not go through you can change the color So the terminal In the basic form is black and white or just two colors but most Computer systems support multi-colored terminals, so we see the different colors of the directories and files We can also change the color of the prompt I'll copy and paste one from the website so they don't have to Waste my time typing it. I think I've made a mistake on the website too What maybe not we can change the color okay? Amazing with this long set of commands Some of those strange characters define the color this slash e in brackets one colon 34m defines the color to be blue of the prompt Again, I copy that from the web page. Remember to copy and paste go to the web page select You don't need to right-click just select Go to your terminal and middle click now. We have a beautiful prompt Some things that this afternoon will go through quickly just to make you all aware of those things like you're aware that this is the prompt and You change it by setting ps1 Exactly how to do it what possible values you can set. I'll let you explore in your own time we We will not go into any more detail the website That web page has some more details and also will point you to where to find more information That's the prompt Can I go back to normal? What was it at the start I think it might have been this if you want to go back to the original one you can Copy it from the website or much easier exit Type exit the terminal will close when you start the terminal again. It will go back to the original So the changes only apply It's not permanent only applies during this terminal to make it permanent We'll see how later It's not too hard. We'll see it with something else So for you I will not do it, but you can exit and start a new terminal another variable When I run ls ls is a program It's an application. Where is it? Which ls tells me ls The executable file in windows. It would be an exe file ls.exe here. It's just ls is in the slash bin directory Why does my shell know when I type ls? Why does it know to execute ls from the bin directory? There may be a copy of ls in other directories It knows from what we call the path the path defines What directory should we search to find an executable? And it's just another variable If you echo dollar path Dollar path is the variable dollar refers to the value echo will print out that value shows A set of directories separated by colons to say that When you try and run a program the shell will look in These directories in order it will first look in home student bin and then I've got home student bin again. That's a mistake And then these other directories I set something up yesterday that Made home student bin repeat. So this is the path You can change it I don't suggest you do Now just make sure that you do have home student bin in your path And at the start some of you may not if I didn't set the computers up correctly. This is saying When I run a program The shell will look in this directory first to see if that program exists If it doesn't exist there, it will move to the second directory if not there It'll keep going if it doesn't exist in any of these directories it will return an error command not found Normally home student bin is not in your path I have added it because we have some software that we're going to create ourselves that We'll put in this bin directory that we want to use during this afternoon Anyone not have slash home student bin at the start of their path Not have it Who doesn't have it twice? Having it twice. It shouldn't be there twice. That's my mistake But it won't hurt If you want to add something to the path maybe Echo will take a Let's try I had a variable we'll do it something else. I had a abc Echo you can combine variables and strings so I have my variable abc which is defined to be steve If I try to echo dollar abc. Hello, it doesn't return anything it prints out empty space that didn't work But if I enclose abc in the curly braces echo abc followed by the string. Hello. It prints steve. Hello So it's very easy to combine Values together can concatenate the strings We can do the same with a path sorry Yeah echo dollar and that's why we should put things in curly braces If you had a new directory called new bin I'm just making it up. We could add it to the path That is we can concatenate the existing path And add on this other string at the end which would include a new directory and to set that We would say Path equals existing path plus The old path Plus the new directory Set the path To be equal to the existing value of path Combined with this new directory Which would effectively add that to the To the path Just a reminder Of course, you can look on here But you should be able to see what i'm typing via the terminal if you're using mux But if you shut it down or for some reason not working Anyone not have the terminal open? If you if you Okay, you can see it. All right. I think most people are okay Just make sure So instead of having to see up there mux is working. Okay, all right good Just to make sure Are you going to set your path? Press enter now and that second that directory will be added to your path I don't want it there. So i'm not going to press enter But you can do it. It won't hurt Okay, we'll do it Now my path is everything as it was before plus slash home slash student slash newbin Which means when I run a program what the shell does it searches through all of these directories to look for that program Ask questions as we go. Otherwise, we'll just quickly move on to the next Next thing is that a question at the back or is that a yawn? I think it's Okay Now what we're going to do is put the commands that we've been running Remember we run a command presenter run a command presenter put them inside a file and run that file a text file So I'll just clear we'll start again We use my text editor nano for you You may want to have multiple terminals open that is three terminals Two of them for your computer and one to see what i'm doing Sometimes it's useful to have two terminals maybe open an editor in one and execute in the second but I will not just for the limited screen space Let's create an example If I can spell No example example one remember file extensions mean nothing in Linux It doesn't matter what file Extension I add it doesn't matter if I don't include a file extension It doesn't have to be dot txt In this case. I'll just call it example one Nano is our text editor like notepad And now we can put commands in there What cd home ls ls minus l That is I want These three commands to be executed when I run this example one file Rather than having to type each command myself Put them in a file and run that file that will run those commands So I've just put three Commands as an example should take me home cd tilde means go to my home directory should ls and then ls in the long format Exit control x Save modified bust it buffer Yes, why for yes file name press enter You want to check if it's there cat Just shows you the context Now, how do we run it? I want to run the commands inside example dot one. Well, the name of our shell is called bash And the way to run one way to run This example dot one is to type bash example dot one Remember to use tab bash e tab auto complete Bash is the shell which will execute in this case should execute the commands inside this file Does it Yes, you see the output of those three commands The first command had no output. It just moved me into a directory The second command it's not so nice on my screen, but the second command was ls It shows these files and the third command ls minus l which shows those files in long format There's what's called a shell script a script Which allows you to automate tasks Any problems with shell scripting? Very easy Just put your commands inside a text file and run that text file Did it not work for someone anyone? Or maybe a better question who got it to work put your hands up? Yes, sure Okay, if you didn't get it to work Did it run yep, okay Very easy now Let's Cover a few more details about those shell scripts and to see a few different Things we can do inside them I'm going to open mine in my text editor again nano example one It's good practice So we can just include the commands But it's good practice to in fact include a special instruction at the top of the file to say Which shell program to use to execute this? And that's a very special syntax the first line should be hash exclamation mark And then the the exact path to the shell script the interpreter And we're going to use bash for all our examples If you don't know what this means don't worry just use it in the top of all your shell scripts It doesn't have to be bash. It can be others. In fact others may be better in some cases But we will use bash for simplicity in our case Hash is normally a comment in shell scripts Anything after a hash is usually a comment in this special case of the first line When it's combined with the exclamation mark. It's not a comment It's a special instruction saying If you execute this file use bash to execute it Don't use some other interpreter hash exclamation mark hash exclamation mark is called bang So this combination is called shebang hash bang shebang So include that at the start of your scripts When you execute it control x save yes enter Again Run it you get exactly the same nothing has changed with regards to the output Let's do something different let's move The example 1 to file into your bin directory Remember move We'll take this file And put it into another directory so it moves it doesn't copy We're doing this because Our path includes the bin directory What we want to do is be able to run this command Without Having to type bash example 1. I want to just type example 1 So we'll set that up move it into bin And let's cd into the bin directory There's already some programs in there from Some I've installed ffmpeg An example 1 is there Again something that you may not understand but you need to accept for today with limited time We need to make this program executable Currently example 1 We are allowed to read it We're allowed to write it We're not allowed to execute it We want to be able to execute it How do we make it Executable This magic command Change the mode such that the user can execute example 1 And now we see an x here All right again Permissions changing the mode is something that we may cover in the lab in semester 2 for those that haven't taken it Or in something like its 335 it security if you're an it student But we will not cover today You see the colors changed to green that's a nice sign Example 1 is now an executable file And because it's in the bin directory And the bin directories in my path I can just type example 1 And it executes Sorry So you should be able to just type You don't have to type bash example 1 just type example 1 If it works Change the mode now Where's the command sorry All right I need to scroll sorry Something that I did which we didn't explain much You must do this chmod u plus x example 1 make that program make that file executable Then you should better run example 1 Anyone else have problems So we now have our own program Example 1 Which actually just calls other programs ls and cd Let's do some more things with a script Let's copy example 1 to example 2 We'll go through a few examples A quick one Now let's edit example 2 nano example 2 Open up example 2 in your text editor And let's change it to be something more interesting Sorry, what did I do then? In nano to delete a line I can do control k cut control k You can delete normally Let's create a variable Don't copy me Set a variable to some value The first line here And then echo some string My name is followed by the value of that variable save And execute I'll leave it up there for a moment. You can save that execute exit nano and execute example 2 save A quick way to save is just exit control x save yes Enter Execute example 2 All right, so this is just our use of variables Same on the command line. We can use them in scripts Next The shell We've all we've done so far is run a command and We get the output Well, it has more complex syntax and it allows different programming constructs It allows what we'll use four loops if statements while loops and many other constructs So we'll just introduce four loops and then if statements and we'll do it inside the shell script I'll just keep copying in my example to a new one Just so I have a record of the old files copy example 2 to example 3 And then edit example 3 I don't want those lines. Let's make something more interesting Four loops the syntax. There's different types. There's different Uh types of syntax for four loops. Let's go through a few common ones four two Left braces Four for example i equal to one. This is similar to c syntax i less than three i plus plus where i is our variable semi colon to close Do and I'll use a tab just to indent. You don't have to echo dollar i done A simple for loop So we're just trying to introduce you to the syntax what you put inside here Well, it can be as complex or as simple as you like Here we're just echoing the value of i You could put in your own commands ls copy files. Whatever you want to do Inside that for loop So the syntax two Left parentheses i equal to one semi colon i less than equal to three semi colon i plus plus to increment i Yep, why would you not have two? How many do you want? Just one Why Why not a square bracket a square brace? Why not a hash? It's just the syntax Okay Now why did they choose so the designer of this language? Why did they choose this syntax? I don't know have to ask the designer But I suspect it's something to do Brackets are used a lot in shell for other purposes So I suspect using a single one may have been conflicting with other purposes of the bracket Okay In fact, I think this is a new addition relatively new compared to the early versions these this syntax That's why we're here Well, no, let's execute Save control x save and and run your example just to be sure you know what's happening example three magic one two three Once it's run Then edit again and we'll add a few more examples of the for loop syntax Anyone not get one two three Okay at the back All right Then open it again And we'll add some different syntax another syntax for Some variable in some list list of strings for example semi colon to close do Whatever you want to do Echo the name done So just a different syntax for the for uh the the loop conditions This is the typical C where you increment a counter for example here for name in this list of string values So in the first instance name will be steve and then it will be tuneruck and then bikini And I think we've got one more We can use similar syntax And this will introduce a new shell operator Instead of defining the list here steve tuneruck bikini Sometimes it's useful to define those lists of values in a file say a text file one per line and then Get the for loop to read that text file and one way to do that I'll write it I forgot to create the data Actually, let's go back and create the data I'll come back to that one Let's save our file If you've got that line there, that's okay, but I want to create the data first Save the file exit We'll come back to it in a moment And now let's create some fake data data one dot txt. I'll call it dot txt nano data one dot txt And let's put some data in it and you can either type it yourself or if you can go to the website I have an example I'll show you If you again the website is linux command line aliases prompts and scripting Scroll down Find our examples of shell scripting Example where'd we get to data one dot txt I'm going to copy and paste these three lines So if on the website if you don't want to type it you're lazy like me you go to the website copy Which is just select I'll go back to that and go to nano and middle clip paste So on the website under four loops, there's an example that says cat data one dot txt I'll zoom in under four loops This is the data I want in the file. It means nothing Okay, it's just something we use as an example If you can't copy it you have to type something yourself Just those three lines starting with one two three ending with ghi So your file data one looks like that save it Yes, just to check cat data one Okay data one contains those three lines of text. What are they? Just some random one or some some strings separated by commas We'll use those commas as field separators in a moment Three lines with three fields each Now go back to our example three and finish our for loop Open the example three in nano Press enter And we'll add one more for loop the third for loop And again if you're lazy you can go to the website and copy the for loop Just make sure everyone has that so far Okay All right, and then we'll go back to the the For loop again, if I Go too fast and you need to let me know or just ask one of your neighbors for a bit of quick help Back in my example three. Let's add the third for loop for line in cat Data one dot txt Semicolon do And we'll do what we want to do But let's first look at this syntax So line is just the variable we can call it what we like it doesn't have to be line It can be abc anything it's a variable And it's going to take the values of the output of this command note these These characters called the the back tick operator sometimes back tick so the the Apostrophe leaning backwards. It's not a normal apostrophe. It needs to be the correct one And cat data one dot txt. What does cat data one dot txt do it just displays the contents of that file Putting it inside these two back tick operators means that The output of this command those three lines of file will be taken as the The information for this for loop And it's read line by line So the effect will be and we'll see it is that Line will take the first line of this file Then in the next iteration the second line of the file and then the third line of the file There should be three iterations there one for each line of data one dot txt If line is confusing rename it, uh, I don't know l It doesn't have to be line Let's do something with each line Echo the line and pipe it into Cut cut take some string cuts it based upon some field delimiter Our field delimiter minus d is the comma and the field that I want is field number two Remember our our lines were delimited by commas Save and run and just make sure it does what you expect it to do Use the website to get the exact syntax if if i've gone too fast there you can get it from the website Did it work? Okay easy Okay, so we take L will take in the first iteration the first line And then the second iteration the second line and the third iteration the third line We'll echo a line And then we'll pipe that into cut Which if we delimit by commas will take field two So the cat data one dot txt means Execute cat data one dot txt and the output of that By using these two back tick operators these two Means the output of that will be the input or as if we typed the output of that here on the On the in the file We'll see another example of those back tick operators. I think shortly they're quite important Let me run mine You should see something like that depending on how you change the values three four loops The last one prints the second field of those Three lines of that file Of course inside your for loop for loop you put whatever you like We're just using simple things for this just to learn the syntax of the for loops Let's keep going example four Copy example three to example four Edit example four Uh And we'll show some cases of if statements The first one we'll do it inside a for loop Instead of printing one two and three inside the first loop. Let's include an if statement Let's introduce a variable. I'll call it cutoff two f's cutoff And set it to two I should be one two and three our cutoff is going to be two Let's introduce the syntax for if statements if And they're quite complex. Well, not obvious sometimes Compared to other programming languages if i dollar i is the value is less than minus l t less than the cutoff and That condition is enclosed in square brackets and they're important They tell the if statement to to test This statement to test if i is less than cutoff And I think you need the spacing correct here I think if you don't have a space after the left after the The left square bracket before the dollar it may not work then If that is true then Echo some message dollar i is less than cutoff else else if elif So else if Do another test dollar i equals cutoff then Echo some other message dollar i is Same as cutoff I'm typing it myself. Sometimes I make some typos and make mistakes. We'll find them later If you don't want to type it yourself, you've got two options copy it from the website You'll get everything or just copy from the terminal as I type All right If you don't want to type it then copy it from what you see in your other terminal But try and understand the syntax and else Echo something else dollar i Is not less than cutoff You don't need the semicolon at the end of these echoes Won't make any difference Close the if with fi What's the opposite of if fi And we have our first example of if statement. So this is one syntax where we're comparing in numbers So dollar i is an integer is a number And cutoff is a number So we can compare them with less than equal to and you guessed that there's gt for greater than there's le for less than and equal to or equal to and a few others Shall we run it run it just to make sure you've made no mistakes You can save control x Yes Example four, okay So i iterates from one two and three inside each iteration A foot the if statement tests the value of i against our cutoff It's just introducing the syntax Yeah, best to do it here There are other ways to do it, but this is just A quick way to get started Any questions? We work our press fg control x Yeah, the first three lines Oh dollar cutoff not percent cutoff If you if you make typos then sometimes you'll get syntax errors or or strange results So you just need to be careful as with any Programming to get the syntax correct Okay, let's quickly get a couple more if statements. Let's continue to edit that file example four That was one form of syntax where we compared numbers We can do string comparison In our second for loop where we listed the three names if and i'll enclose it in double quotes if name And a good practice is to include the curly braces If name here we use equals to do string comparison Then echo fi closes the if statement Okay, so there are no I don't know curly braces like in c to open and close we use fi to close then echo something and While we're here Let's add another one. So this one is just comparing strings so we can use equals Minus eq to compare numbers equals to compare strings And it's good practice to have everything in double quotes to make sure it is a string Because if dollar name was an integer Then we'd be comparing a number against a string which may be a problem So it should say you should iterate through the three names and when it gets to tanaraki or echo out a string last one Here we did What do we do? Here we did a cat on data one dot txt But what if the file did not exist if there was no such file data one dot txt Then this script would return an error if we try to cat a file that's not there So it's good practice to check and see if it exists before we use it And we can do an if statement if And minus e means if the file exists Then This is not very useful Because what if it doesn't exist But i'll just introduce the syntax then we'll fix it Minus e is a special operator is used for testing about files and directories Minus e means if the file exists So if data one dot txt is a file and it is present in the directory Then this will return true and we'll echo it exists If there's no such file then this conditional statement will return false Maybe we'd like to do not If it doesn't exist Then if the file is not there, but we want it to in the next for loop Then we should exit not the exclamation mark is a uh an Negation here. So if data one dot txt does not exist if I've got the syntax correct Then echo this error message and exit this script Don't continue That's what this exit means. It means we were not going to the for loop We shouldn't because the for loop relies on this file if it doesn't exist then we should stop I may have made a mistake with the syntax. We'll come back to it. Let's test and see if it works Run example four Tanarak is my boss and it shows those values And let's move data one to be data two Therefore data one would not exist Then it handles that case I'll show you the if statement in a moment, but just check if it does what you expect When you see syntax area something's gone wrong. Don't continue Look on open up the website And to get things clear copy and paste from there to overwrite. So you're back to a A working example So the idea is we check if a file exists Before we use it Everything works, but you're getting errors to me. That means not everything works Errors warnings and errors are not good. Okay What's it say? Control c Maybe a space here Try to use I'm not sure, but I think a space there Yeah That fix some minus e space before the minus e Make oh no, okay All right line nine so nano And control c will tell you the line Line three so you scroll down a very primitive Scroll down Try a space after elif I'm not sure. I think it's acceptable if Something's wrong Try different Again No, there's a problem at the start After the echo a space echo Yeah Save Still an error down a line 16. Okay. I think you've got two done For only the for loop needs are done So the second done How do you change Similar if you go to my the website, there's a example about the prompts and but I don't try it now. It's it's quite confusing But you you'll find it later Line 15 again. They're done Only one done You need one done for one do Okay, yep delete one Delete done Yep And here as well Yeah Yeah Okay Okay To find the line number inside nano you can use control c and it'll show you the line number So if you've got an error scroll down press control c scroll down scroll Okay control c Line 36 so The minus e in that conditional statement Was a special character a special Operator to say if a file exists. There are many others if a file if it's a directory if it's File of a particular type To find out all of those Operators these square brackets Are implementing a test Okay, and to find out about the syntax the program is actually called test. So man test will explain The syntax the square brackets is just a short form of using the program test And if you scroll through you'll see all the the different Operators that you have available and or string comparison integer comparison File checks Is the file a particular type does it exist? Is it a directory and different things so you can do checks on files Very useful if you want to automate tasks Tasks on files you want to check if it exists before you do something with it Q to quit do we have one more example shell script? One quick example to finish shell scripts because we want to move on I'm going to copy. I know if you didn't get it working we'll come around and Even if you if you still have trouble with Examples one to four maybe put your hand up and one of the others will come around and help while I try and present Just so we can keep moving Um Or I'll come around after I go through example five Let's do example five last thing. I'm going to copy example one our very first one to example five doesn't matter which one but Example one was the shortest And edit Sorry Edit example five our last shell script example We can use input parameters What's the case? So anything that starts with a dollar sign refers to a very the value of a variable, but there are some special cases dollar one refers to the first input parameter to this command dollar two the second input parameter These are called positional parameters So ls minus l dollar one So when I run this script I must enter in the parameter on the command line Piper into grep dollar two ls minus l dollar one pipe grep dollar two save and run it and we need to pass in two parameters Dollar one will be replaced by the first parameter and dollar two by the second parameter And I just for this example example five Had inside the script dollar one and dollar two they will be replaced with the first and second parameter on the command line And just for this example it was ls minus l sum directory user slash bin Piper into grep and search for a string the string i'm searching for is vlc which means Find me all files in that directory which have the name vl or have the string vlc in their name And it shows you c vlc n vlc and a few others So this is just an example of positional parameters or input parameters to a script Which means you can create a script that Takes parameters as input And then reuse that script and it can be more generic than if it's specific to The files and and directories and strings That's our last shell script Last example Before we move on to some other things questions The things our shell scripts did were not very interesting It's up to you to put the commands inside to make it do what what do you want it to do? We just introduce the syntax Everything okay now Yeah, easy You need two parameters where we're going 50 minutes, okay