yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Shell Scripting Lesson 1


3m read
·Nov 3, 2024

Processing might take a few minutes. Refresh later.

Hey guys, this is Matt. Kids on one and today is going to be, um, shell scripting lesson one.

The deal with this is that there's a programming language basically built into terminal that you probably don't know about. It's not really considerably a programming language, but it's pretty powerful, and there are a bunch of scripts on your computer that use it that you probably don't know about.

So let me just, um, explain this to you. When you open up terminal or iTerm or something like that, you'll notice that, um, basically this command line will come up, and it lets you type commands. But, say you use something like iTerm instead of terminal; yeah, it's exactly the same, except for maybe the GUI of the application, but the text is all the same.

Let me explain to you why, because this is actually a terminal application running in terminal. Um, so terminal is just one big terminal application running in terminal called bash or sh or a sh or whatever these are called. Shells, and the shell is basically something that handles the login, handles commands, handles, you know, prompts, and handles closing programs and running new programs and stuff like that.

So shell, this might, my shell is processing this. If I hit like a sh, it's not installed, but zsh I think I might have; you can see it's a different prompt here. The shell is a little bit different. If I type csh, it might be in here. Then this is, um, shell scripting or more like c. But I'm basically, let me just explain to you what your default shell is. It's bash, be a sh.

Um, and this is basically a shell that processes commands. You might have noticed that the command line, if you type while true to enter, it'll ask you to type another one. You can type echo, you know, hi, and then you can type done, and then it'll keep on printing out hi, something like that. Well, that was just a shell script that we wrote there because the point is that this shell is like a programming language, and you can program it at the command line.

Normally, typically, you can only program one line programs. So if you type ls, that's a one line program. The only command in that whole program is ls. Or, if you want to type multiple commands, it can be ls semicolon space ls dash out our /. Then first, I'll type ls then gl a special r /. Instantly, but, um, maybe you don't enjoy that so much and you want to do something else.

So maybe you want to write a shell script. If you do want to learn some shell scripting, feel free to watch our shell scripting to video, and it will show you how to write a program effectively and easily using bash and terminal. It's pretty powerful; it allows you to, um, do if statements, check if files exist, have command line parameters.

Info 101 was written mostly with, um, Perl, but there was a lot of shell scripting involved in it. I'll just show you real quick, um, what info 101 really looks like. If you take a look at the source code of it, because it's actually open source, just if you open it with Mac VI, em. So I'll just open it with Mac VI m, and right here you can see, um, it's all shell scripting. This is really simple shell.

So info 101 was written mostly in shell scripting. That is why you should learn shell scripting; it's just pretty powerful. So thanks for watching. Makinson on, check out RM's shell scripting to video right now because it'll have all the information you need on how to shell script. So, I thanks for watching him b...

More Articles

View All
This Clown Philosopher Lives in a Wonderful, Whimsical World | Short Film Showcase
[Music] Yod Vav shkodra yeah do CPR on a boulevardier pervert a miracle mr. lavalla mira que dios famous BDSM ha ha Mazama yep knocking children [Music] staros the second coaches plasma s which he’ll long as a machinist decision he just melted if you will…
Akashinga: The Brave Ones | National Geographic
So foreign, today we are expecting 500 results that are coming in from 500. He wants 822 graduates. This training is going to be hard, but I know these ladies. They are strong ladies. As we are coming here, everyone—we know we are coming here for training…
Worked example: Finding the formula of an ionic compound | AP Chemistry | Khan Academy
Let’s now see if we could come up with the chemical formula for the ionic compound calcium bromide. And like always, if you are inspired, pause the video and see if you could come up with it on your own. All right, so the convention is that we write the …
Using Time Machine without Another Hardrive
Hey guys, this is Maads 101. As many of you know, if you go into Time Machine and you don’t have an external hard drive, it’s just going to say “Set up Time Machine”. If you don’t have an external hard drive, it might be very annoying, and you want to bac…
How do you deal with stress Jeff Bezos
The stress primarily comes from not taking action over something that you can have some control over. So, if I find that some particular thing is causing me to have stress, that’s a, uh, a warning flag for me. What it means is there’s something that I hav…
Gradient and contour maps
So here I want to talk about the gradient in the context of a contour map. Let’s say we have a multivariable function, a two-variable function, f of x, y, and this one is just going to equal x * y. So we can visualize this with a contour map just on the …