Shell
A program, takes command from the keyboard and give it to the OS -> execute task/ function.
Main function: Interact with the operating system (OS)
How human use shell program
- Users: GUI (graphical user interfaces): button, icon, pointer, menu, scroll bar -> Anything that helps users to interact with the computer.
- Developers: CLI (command line interfaces): Interact with the computer through terminal: cd, ls, rm,... -> Text-based interfaces.
bash is an enhanced version of Shell program, the same with ksh, tcsh, zsh
Shell script
A list of commands that describes the steps that need to be executed. Those steps can be program execution, file manipulation or text printing.
To create Shell script
- open editor (vim/ vs code). name script file using .sh
- start the script with #!/bin/sh or #! /bin/bash
- write code
- my first script
- echo "Hello World, I'm practicing shell scripting"
- save as filename.sh
- executing: open terminal. type bash filename.sh