Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bash_Scripting

Learning bash scripting for automation based on this tutorial.

First Part

Making an executable and compiling through:

chmod +x <filename>.sh
./<filename>.sh

Checking default interpreter with:

echo $SHELL

Define shell interpreter explicitly with:

#!/bin/bash

Alternative to execute a bash script is with:

$ bash <filename>.sh

In this way the content of the file is directly loaded and interpreted as a script.

Some Notes on Shell commands:

  • Navigating to the previous location you were with cd -
  • Any command output can be recorded in a file through >, for example echo "Hello World" > text.txt will create text.txt file with "Hello World"
  • Assigning variables happens as usual but you cannot use spaces a = 8 is not valid but a=8 is
  • Calling variables is done with "$" -> echo $a will display a's value

About

Learning bash scripting for automation based on some tutorials

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages