dotfiles/lib/vars.lib.sh
2023-09-01 01:40:41 +02:00

11 lines
No EOL
171 B
Bash

#!/bin/sh
safevar() {
echo "$@" | sed 's_/_\\/_g'
}
subvars() {
echo "$@" \
| sed "s/{{home}}/$(safevar $HOME)/g" \
| sed "s/{{user}}/$USER/g"
}