Skip to content

aKumoSolutions/Bash-Scripting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bash Scripting for SysAdmins


What is Bash Script?

A Bash script is a plain text file which contains a series of commands. These commands are a mixture of commands we would normally type ouselves on the command line (such as ls or cp for example).

Hello World Bash Shell Script

Writing your first, basic bash shell script. Using any text editor create a file called helloworld.sh, add the following code.

#!/bin/bash

echo "hello world"

Run your script:

bash helloworld.sh

Folders

Folder Description
arrays Basics of Bash Arrays
simplescripts Basics of Bash Scripting
tasks Simple Bash tasks/challenges
scripts Sample Scripts

Useful Tips for Writing Effective Bash Scripts

  1. Always use comments in your scripts
  2. Make a script exit when it fails
  3. Use double quotes to reference variables
  4. Use Uppercase names for environment variables and lowercase for custom variables
  5. Use functions in scripts

Contributors

All Contributors

Project Status

All Contributors

About

Bash scripting for Unix-Linux SysAdmins.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages