A Bash Code Snippets Extension.
Usage
- Install the extension in VS Code
- Create a new
.shfile - Type the snippet prefix (e.g.,
shebang,fori) and pressTaborEnterto expand
Features
| Snippet | Description |
|---|---|
#!/usr/bin/env |
Shebang template with script description |
scriptdir |
Get the directory of the currently running script |
function |
Define a function in Bash |
case |
Case statement for pattern matching |
fori |
C-style for loop iterating N times |
forarray |
For loop over array elements |
readlinefile |
Read a file line by line |
readlinecommand |
Read command output line by line |
readlinevariable |
Read a variable content line by line |
License
This project is open source, licensed under the MIT License.