1 : run this script through /bin/sh
2 : '@(#)$Id: version.sh,v 1.9 1992/01/30 22:20:41 jromine Exp jromine $'
10 for A in rprompt hostname uname who
14 if [ ! -f $D/$A ]; then
18 rprompt) LOCAL=`$A %h`
24 who) LOCAL=`$A am i | sed -e 's%^\(.*\)!.*$%\1%'`
29 if [ "x$LOCAL" != x ]; then
37 if [ ! -r version ]; then echo "0" > version; fi
38 if [ ! -r ${Patch} ]; then Patch="" ; fi
42 cat version ${Patch} |\
44 BEGIN { split ("'"${1}"'", ver, ".");\
45 major = ver[1]; minor = ver[2]; patch = ver[3]} \
46 NR == 1 { local = $(NF) } ;\
47 NR == 2 { patch = $(NF) } ;\
50 printf "char *version = \"@(#)MH %s.%s.%s #%d[UCI]", \
51 major, minor, patch, local > "version.c"; \
52 printf ".ds MH %s.%s.%s #%d[UCI]\n", \
53 major, minor, patch, local > "../doc/version.rf"; \
54 printf "MH %s.%s.%s #%d[UCI]\n", major, minor, patch, local ;\
56 printf "char *version = \"@(#)MH %s.%s #%d[UCI] ", \
57 major, minor, local > "version.c"; \
58 printf ".ds MH %s.%s #%d[UCI]\n", \
59 major, minor, local > "../doc/version.rf"; \
60 printf "MH %s.%s #%d[UCI]\n", major, minor, local ;\
62 printf "%s.%s.%s.%d\n", major, minor, patch, local > "_version";\
63 }' && mv _version version
65 x) echo ' ('$LOCAL') of '`date`'";' >> version.c ;;
66 x-n) echo '";' >> version.c ;;