1 # $Id: modmisc,v 1.4 2006/05/11 15:37:07 sjg Exp $
3 # miscellaneous modifier tests
5 path=:/bin:/usr/bin::/sbin:/usr/sbin:.:/home/user/bin:.
7 MOD_NODOT=S/:/ /g:N.:ts:
8 # and decorate, note that $'s need to be doubled. Also note that
9 # the modifier_variable can be used with other modifiers.
10 MOD_NODOTX=S/:/ /g:N.:@d@'$$d'@
11 # another mod - pretend it is more interesting
12 MOD_HOMES=S,/home/,/homes/,
13 MOD_OPT=@d@$${exists($$d):?$$d:$${d:S,/usr,/opt,}}@
16 all: modvar modvarloop
19 @echo "path='${path}'"
20 @echo "path='${path:${MOD_NODOT}}'"
21 @echo "path='${path:S,home,homes,:${MOD_NODOT}}'"
22 @echo "path=${path:${MOD_NODOTX}:ts:}"
23 @echo "path=${path:${MOD_HOMES}:${MOD_NODOTX}:ts:}"
25 .for d in ${path:${MOD_SEP}:N.} /usr/xbin
26 path_$d?= ${d:${MOD_OPT}:${MOD_HOMES}}/
27 paths+= ${d:${MOD_OPT}:${MOD_HOMES}}
31 @echo "path_/usr/xbin=${path_/usr/xbin}"
32 @echo "paths=${paths}"
33 @echo "PATHS=${paths:tu}"