Shell script snippet
Learn Bash Scripting with Shellman, examples included. Download free ebook (pdf, epub, mobi).
Read Shellman story on medium (3 min read).
fn... / fx... example
- bashdb (If you need to debug your scripts)
Install extension in vscode by:
ext install Remisa.shellman
Start typing and Shellman will provide you available commands.
For more convenience similar commands are grouped into same prefixes. Here is an overview:
Shebang should be used as the first line of your script. You can replace
bash with any other installed scripting language like
argument parsing |
Parse command-line arguments
Run external commands and check if operation succeeded.
Snippets related to function.
Iterate different collections/arrays...
Write in bold, italic, dim, reverse format.
Web methods and functionalities: GET, POST...
Wide range of logical conditions which are more common in bash scripts.
Start and stop, stopwatch and read elapsed time.
inserts a whole function into script. Function declaration should proceed its usage.
Call function which is declared by
Function usage examples
- banner simple
- print a banner with provided title.
banner_simple "my title"
- banner color
- print a color banner.
banner_color red "my title"
- Organize your project and reuse functions. Import functions from other shell script files. Default import directory is
lib. This directory should be where the calling script exists and contain library files with
.sh extension. For example if
libname.sh contains some useful functions and exists in
lib directory, you can import those functions into your script and call them.
import "somefile" will import all defined functions in
lib directory where calling script resides.
- Create some frames with same size using
animation frame snippet.
animate function using
fn animation animate snippet.
- Check sample animations.
Latest release Notes
Shellman ebook release. Download free ebook (pdf, epub, mobi)
- Fixed issues #20 and #21.
directory delete nested |
directory remove nested: delete directory and all contents.
summary snippet to include exit codes.
- Added samples: