From the course: LPI Linux Essentials (010-160) Cert Prep
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Turning commands into a script - Linux Tutorial
From the course: LPI Linux Essentials (010-160) Cert Prep
Turning commands into a script
- [Instructor] In this lesson, we're going to learn a little more about scripting and start putting together some of the script components and make a couple of basic scripts. Now, the first one I want to show you is this script known as directory listing.sh. Now, what I'm going to do is just cat it to the screen so you can see it. Cause they already typed it up for us to save us some time because it's pretty straightforward. Now, you'll see here that the first four lines all start with a hash tag. Now that hash tag means comment, it means we're going to ignore everything in those lines. It's just for us, the humans to read but the computer is going to not pretend it's there at all. So what I'm saying here in the first line, this exclamation slash bin slash bash is that this is a bash script. The next line tells you what the script is for. It's a simple script to output the files in the current directory to the screen.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Text files and text editors3m 55s
-
Using vi and nano8m 57s
-
(Locked)
Beginning a shell script2m 33s
-
(Locked)
Commands4m 38s
-
(Locked)
Arguments2m 35s
-
(Locked)
Variables3m 24s
-
(Locked)
Conditional expressions4m 39s
-
(Locked)
Loops and functions3m 48s
-
(Locked)
Exit value2m 17s
-
(Locked)
Turning commands into a script11m 39s
-
(Locked)
-
-
-
-
-