Add 'bash/README.md'

This commit is contained in:
daryl
2022-07-01 10:26:37 +09:30
parent 6e84f47624
commit 3fb7937c45

29
bash/README.md Normal file
View File

@@ -0,0 +1,29 @@
# Useful BASH snippets.
## argument_parsing.bash
Handling command line argument / parameter parsing at the beginning of a script.
## booleans.bash
BASH doesn't actually have booleans, but there's tricks to make variables behave enough like bools to be useful.
## internal_function_w_output_and_return.bash
The right way to have an interal function inside your script, have it output to STDOUT and also have various return values that you can action once the function is completed.
## internal_output_tee.bash
The magic way to abuse exec to have your entire script tee to both log file and STDOUT with a simple line at the top, rather than tee pipes plastered throughout your script.
## script_runtime.bash
Quick and easy script runtime output.
## tmux_launcher.bash
tmux wrapper for another script, e.g. to have top running in part of your terminal while another task runs in the button, then nicely clean up afterwards.
## usage_help.bash
Put your usage output in a function to make it easily callable from multiple places as required.