Presentation is loading. Please wait.

Presentation is loading. Please wait.

BASH Scripting #SWIFT sareebro. What is a shell script? Script: a writing; a written document – Webster's Dictionary A shell script is an easy-to-use.

Similar presentations


Presentation on theme: "BASH Scripting #SWIFT sareebro. What is a shell script? Script: a writing; a written document – Webster's Dictionary A shell script is an easy-to-use."— Presentation transcript:

1 BASH Scripting #SWIFT sareebro

2 What is a shell script? Script: a writing; a written document – Webster's Dictionary A shell script is an easy-to-use tool for application building that “glues together” system calls, tools, utilities, etc. Shell Scripts can invoke the commands available in Linux.

3 Why? Useful tool for System Administrators Avoid having to retype repetitive commands Scripts become a program – a tool that can easily be customized for a particular application

4 How? #!/bin/bash Start with a sha-bang (#!)  Placed at the head of a script  #! is a two-byte magic number designating the file type (or executable shell script)  Tells your system that this file is a set of commands to be fed to the command interpreter indicated

5 Chmod then execute Change mode: command lets a user tell the system how much access it should permit a file Make the BASH script executable chmod +x myscript.sh Execute your script (dot-slash)./myscript.sh

6 Demo We shall now make a simple BASH script!


Download ppt "BASH Scripting #SWIFT sareebro. What is a shell script? Script: a writing; a written document – Webster's Dictionary A shell script is an easy-to-use."

Similar presentations


Ads by Google