| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $Id: modmisc.mk,v 1.4 2020/07/03 15:33:01 rillig Exp $ | | 1 | # $Id: modmisc.mk,v 1.5 2020/07/03 15:41:37 rillig Exp $ |
2 | # | | 2 | # |
3 | # miscellaneous modifier tests | | 3 | # miscellaneous modifier tests |
4 | | | 4 | |
5 | # do not put any dirs in this list which exist on some | | 5 | # do not put any dirs in this list which exist on some |
6 | # but not all target systems - an exists() check is below. | | 6 | # but not all target systems - an exists() check is below. |
7 | path=:/bin:/tmp::/:.:/no/such/dir:. | | 7 | path=:/bin:/tmp::/:.:/no/such/dir:. |
8 | # strip cwd from path. | | 8 | # strip cwd from path. |
9 | MOD_NODOT=S/:/ /g:N.:ts: | | 9 | MOD_NODOT=S/:/ /g:N.:ts: |
10 | # and decorate, note that $'s need to be doubled. Also note that | | 10 | # and decorate, note that $'s need to be doubled. Also note that |
11 | # the modifier_variable can be used with other modifiers. | | 11 | # the modifier_variable can be used with other modifiers. |
12 | MOD_NODOTX=S/:/ /g:N.:@d@'$$d'@ | | 12 | MOD_NODOTX=S/:/ /g:N.:@d@'$$d'@ |
13 | # another mod - pretend it is more interesting | | 13 | # another mod - pretend it is more interesting |
14 | MOD_HOMES=S,/home/,/homes/, | | 14 | MOD_HOMES=S,/home/,/homes/, |
| @@ -32,13 +32,14 @@ path_$d?= ${d:${MOD_OPT}:${MOD_HOMES}}/ | | | @@ -32,13 +32,14 @@ path_$d?= ${d:${MOD_OPT}:${MOD_HOMES}}/ |
32 | paths+= ${d:${MOD_OPT}:${MOD_HOMES}} | | 32 | paths+= ${d:${MOD_OPT}:${MOD_HOMES}} |
33 | .endfor | | 33 | .endfor |
34 | | | 34 | |
35 | modvarloop: | | 35 | modvarloop: |
36 | @echo "path_/usr/xbin=${path_/usr/xbin}" | | 36 | @echo "path_/usr/xbin=${path_/usr/xbin}" |
37 | @echo "paths=${paths}" | | 37 | @echo "paths=${paths}" |
38 | @echo "PATHS=${paths:tu}" | | 38 | @echo "PATHS=${paths:tu}" |
39 | | | 39 | |
40 | PATHNAMES= a/b/c def archive.tar.gz conf.d/file | | 40 | PATHNAMES= a/b/c def archive.tar.gz conf.d/file |
41 | mod-HTE: | | 41 | mod-HTE: |
42 | @echo "head of '"${PATHNAMES:Q}"' is '"${PATHNAMES:H:Q} | | 42 | @echo "head of '"${PATHNAMES:Q}"' is '"${PATHNAMES:H:Q} |
43 | @echo "tail of '"${PATHNAMES:Q}"' is '"${PATHNAMES:T:Q} | | 43 | @echo "tail of '"${PATHNAMES:Q}"' is '"${PATHNAMES:T:Q} |
44 | @echo "suffix of '"${PATHNAMES:Q}"' is '"${PATHNAMES:E:Q} | | 44 | @echo "suffix of '"${PATHNAMES:Q}"' is '"${PATHNAMES:E:Q} |
| | | 45 | @echo "root of '"${PATHNAMES:Q}"' is '"${PATHNAMES:R:Q} |