Browse Source

Update README for installer

master
dig 4 years ago
parent
commit
00c9868ebd
  1. 18
      shtpl/README.md

18
shtpl/README.md

@ -1,11 +1,19 @@
# shtpl
> sh templating
> bash templating
## Install
Put the `shtpl` script somewhere meant for executable scripts like `~/bin/shtpl`.
Clone or download this repository:
`git clone $p2git/dig/bash-utils.git`
Put the `shtpl` script somewhere meant for executable scripts like `/usr/local/bin/shtpl`.
Make it executable: `chmod +x shtpl`.
or let the installer do it for you :)
`bash-utils/shtpl/install`
## Usage
Create a template file to be executed with shtpl:
@ -14,7 +22,7 @@ Create a template file to be executed with shtpl:
nano someTpl.shtpl
```
```
#!/path/to/shtpl
#!/usr/bin/env shtpl
Hello $WHO !
```
@ -51,7 +59,7 @@ WHO=Doctor ./someTpl.shtpl > doctorGreetings.txt
shtpl uses a hack to turn you file into a call of `echo "<your file here>"`, so it is simple, all what your system is able to understand as substitution is valid !
```
#!/path/to/shtpl
#!/usr/bin/env shtpl
Simple variable: $ENV_VAR , and with brackets: ${TOTO}cm²
Sub commands: $(echo ok)
@ -85,4 +93,4 @@ Prompt user input in place: your input
Loops: [0][1][2][3][4][5][6][7][8][9][10]
Call sub templates: what the template returns with "aze"
```
```

Loading…
Cancel
Save