File: process

package info (click to toggle)
deutex 4.4.902-10
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 1,096 kB
  • ctags: 996
  • sloc: ansic: 10,805; sh: 424; makefile: 337; perl: 145; csh: 4
file content (26 lines) | stat: -rwxr-xr-x 586 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
#
#	process - expand certain macro expressions in text files
#	Usage: process <file>
#	AYM 1999-08-13
#

# In <file>, replace occurrences of
# - "$DATE"        by the YYYY-MM-DD current time,
# - "$SELF_DATE"   by the YYYY-MM-DD mtime of <file>,
# - "$VERSION"     by the contents of the file ./VERSION.
# Output is written on stdout.

file=$1
shift
sed -e "s/\$DATE/`date +%Y-%m-%d`/
	s/\$SELF_DATE/`find $file -printf '%TY-%Tm-%Td'`/
	s/\$VERSION/`cat VERSION`/
	/\$OPTIONS/ {
	  r unixtmp1/deutex.6.opt
	  d
	}
	/\$DIAGNOSTICS/ {
	  r unixtmp1/deutex.6.diag
	  d
	}" $file