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
Finding decreasing interval given the function | AP Calculus AB | Khan Academy
So we have the function ( f(x) = x^6 - 3x^5 ) and we want to know over what intervals is ( f ) decreasing. We’re going to do it without even having to graph ( y = f(x) ). The way we do that is we look at the derivative of ( f ) with respect to ( x ) and t…
Writing inequalities to represent real-world problems | Grade 8 (TX) | Khan Academy
We’re told at the beginning of summer the city pool advertises a special offer. Swimmers can pay an initial fee of $20, and then the daily admission will be $4 per day. Without the special offer, the standard price is $8 per day. Irene wants to know after…
Why The Mind Hates Meditation
To avoid all evil, to cultivate good, and to cleanse one’s mind - this is the teaching of the Buddha. Meditation has been scientifically proven to have many health benefits, like reduced anxiety and better emotional health. While this is great, I also see…
Still Human | Nobel Peace Prize Shorts
[Music] Don’t you talk about it. [Music] Ahem, of Kundalini. Yeah, near question item cool. Alexander returneth to cool. Remove a new drama for their which my basket. Could you rather lag in the belief that it would man build over be our mother the way an…
See Why This Roller Skating Girl Squad Is the First of Its Kind | Short Film Showcase
The thing that I love about Derby is I forget everything around me when I’m playing. Every one of us kind of have nicknames, so my nickname around there be as shiny tiny, because I’m tiny, I’m short, and I had this like bling. Users like shiny tiny, and m…
Dot Com Makes Good | Wicked Tuna
We’re gonna go over to Dave and check his fish out. Steam it, steam it, baby! You having fun yet? Huh? Yeah, huh? This is no round just drive-bys, right? We mark that man big. The meat is pink, beautiful! Here, we’re gonna make a lot of money here. Till …