File: nnspew.sh

package info (click to toggle)
nn 6.7.3-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,480 kB
  • ctags: 3,198
  • sloc: ansic: 32,028; sh: 1,491; awk: 138; makefile: 96
file content (21 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# nnspew -- generate subject line database
#
# From: James A. Woods (ames!jaw), NASA Ames Research Center
#
# Updates the auxiliary 'subjects' file.  It must be activated regularly
# via a system-wide 'cron' or 'at' command, e.g.
#
# 	2 6,9,12,15,18,21 * * *  root /bin/nice /usr/lib/nn/nnspew

trap "rm -f $TMP/nnsubj$$* ; exit" 0 1 2 15

# We use a "secret" 'nn -SPEW' call to do the hard part:

if $BIN/nn -SPEW < /dev/null > $TMP/nnsubj$$a
then
	if sort -u $TMP/nnsubj$$a > $TMP/nnsubj$$b
	then
		mv $TMP/nnsubj$$b $DB/subjects
		chmod 644 $DB/subjects
	fi
fi