summaryrefslogtreecommitdiff
path: root/biblio/bibtex/utils/bibtools/citekeys
blob: dfcc3aa346abeaaac2a818517ae69e45936c9665 (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/csh -f
#
# citekeys - print out all the cite keys in given bib files
#
# usage: 
#    citekeys file.bib... 
#

onintr cleanup

if ($#argv < 1) then
	   echo 'usage: citekeys file.bib...'
	   exit 1
endif

unset files
foreach i ($*)
	if ($i:e == bib) then
 		set file=$i:r
	else
 		set file=$i
	endif
	
	if ($?files) then
		set files=($files,$i)
	else
		set files=($file)
	endif
end

echo creating citekeys.aux for $files

cat > citekeys.aux <<EOF
\relax 
\citation{*}
\bibstyle{citekeys}
\bibdata{$files}
EOF

rm -f citekeys.{log,dvi,bbl,blg}

echo bibtex citekeys
bibtex citekeys

mv citekeys.bbl citekeys.out

echo ""
echo output is in citekeys.out

cleanup:
rm -f citekeys.{tex,aux,log,dvi,bbl,blg}