bash-utils/shtpl/shtpl

23 lines
304 B
Plaintext
Raw Normal View History

2018-10-09 16:54:38 +02:00
#!/bin/bash
2019-03-02 21:12:33 +01:00
# Utils
__shtpl_path__=$(realpath $0)
__shtpl_dir__=$(dirname $0)
__tpl_path__=$(realpath $1)
__tpl_name__=$(basename $__tpl_path__)
__tpl_dir__=$(dirname $__tpl_path__)
# Execution
2018-10-09 16:54:38 +02:00
eval "echo \"$(cat $1 | sed '
2019-03-02 21:12:33 +01:00
# Suppress hashbang
2018-10-09 16:54:38 +02:00
1{ /#\!.*shtpl/ d }
2019-03-02 21:12:33 +01:00
# Excape quotes
2018-10-09 16:54:38 +02:00
s/"/\\"/g
')\""