Update README for installer

This commit is contained in:
dig 2019-03-02 21:25:53 +01:00
parent 0dfc76bd1a
commit 00c9868ebd
1 changed files with 13 additions and 5 deletions

View File

@ -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)