- Bash-guide - A guide to learn bash.
- bash-it - A community Bash framework.
- Bash-Oneliner - A collection of handy Bash One-Liners and terminal tricks for data processing and Linux system maintenance.
- bashell - A simple git repository framework for unit-testing your bash scripts, coded purely using BASH script too.
- bashell snap package
- Dmatch - a simple pattern matching implementation to get and organize the results of the dumps.
- ExplainShell.com
- Extracter - This is a simple script that can extract any kind of archive.
- Most Useful Bash Scripts for Linux System Administrator
- Parsing data in bash
- pSpy - Monitor linux processes without root permissions
- Shell Scripting for Beginners – How to Write Bash Scripts in Linux
- shellcheck - ShellCheck, a static analysis tool for shell scripts
- Shellntel's scripts - A collection of scripts from the security professionals at www.shellntel.com.
- A script should be run without errors
- It should perform the task for which it is intended
- Program logic is clearly defined and apparent
- A script does not do unnecessary work
- Scripts should be reusable
- Try using "set -x" which prints commands and their arguments as they are executed.
Always use comments, so other people can easier understand your thinking, and the purpose of the script/commad.
#this is a singel comment
<#
multiple
lines
of
comments
<#
Nother way is using Here Document
<< Multiline_Comment
this is
also multiple
lines
Multiline_Comment
If a certain command fails it often affects the rest of the script. To make the script exit if a command fails, use one of these:
set -o errexit #option 1
set -e #option 2
If an undeclared variable is used, it can result in logical error. Instruct bash to stop if an undeclared variable is trying to be used.
set -o nounset #option 1
set -u #option 2
== is synonym for =. Use single = when comparing a string
variable1="testing
variable2="test"
if [ "$variable1" = "$variable2" ]