From the course: Cert Prep LPIC-1 Exam 102 (Version 5.0)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

What is a shell script?

What is a shell script? - Linux Tutorial

From the course: Cert Prep LPIC-1 Exam 102 (Version 5.0)

Start my 1-month free trial

What is a shell script?

- [Instructor] The beauty of shell scripting is that we don't need a complex development environment to get started. To make a shell scrip that acts like a system command, we do need to do a few things. First, we create a text file in our favorite text editor. In a terminal, type in VI space tilde slash script.sh. We've named it script.sh so that VI will do syntax highlighting for us. Scripts don't have to be named like this but it makes it nicer for text editors. Syntax highlighting makes debugging easier. Hit enter. For the next step we need to edit the text file and make the first line point to the shell interpreter. We can do this by pointing at it directly to the shell interpreter by using the absolute path. Go into insert mode by pressing the I key, then add hash bang, slash bin, slash bash. In this case we're specifying an absolute path to the bash interpreter executable. We can also use a second form. Hash…

Contents