Implement alt-link wildcards (#43)

This commit is contained in:
Tim Byrne 2017-01-18 01:13:27 -06:00
parent 3ea710317a
commit eaa252f721
No known key found for this signature in database
GPG Key ID: 6CBE24C2FD8CF76E
1 changed files with 3 additions and 0 deletions

3
yadm
View File

@ -110,9 +110,12 @@ function alt() {
#; regex for matching "<file>##SYSTEM.HOSTNAME.USER"
match_system=$(uname -s)
match_system="(%|$match_system)"
match_host=$(hostname)
match_host=${match_host%%.*} #; trim any domain from hostname
match_host="(%|$match_host)"
match_user=$(id -u -n)
match_user="(%|$match_user)"
match="^(.+)##($match_system|$match_system\.$match_host|$match_system\.$match_host\.$match_user|())$"
#; process relative to YADM_WORK