source: trunk/biblehal/biblehal-explode @ 179

Last change on this file since 179 was 8, checked in by g7moreau, 13 years ago
  • Move biblehal folder in subfolder of trakata
  • Property svn:executable set to *
File size: 832 bytes
RevLine 
[2]1#!/bin/bash
2#
3# gabriel 2010/06/03
4
5export PATH="/bin:/usr/bin:/usr/lib/biblehal"
6
7
8year=$1; shift
9
10if [ ! -e /var/cache/biblehal/download/hal-extract-auto-${year}.bib ]
11then
12   echo "Usage biblehal-explode year"
13   echo " File /var/cache/biblehal/download/hal-extract-auto-${year}.bib must exist"
14   exit 1
15fi
16
17mkdir -p /var/cache/biblehal/explode
18
19index=0
20while read -r line ; do
21   echo ${line} | egrep '^%% .*-[[:digit:]]+, version' > /dev/null
22   if [[ $? -eq 0 ]]
23   then
24      index=$(echo ${line} | awk '{print $2}' | cut -f 1 -d ',')
25      [ -e /var/cache/biblehal/explode/hal-${index}.bib ] && rm /var/cache/biblehal/explode/hal-${index}.bib
26   fi
27   echo -E ${line} >> /var/cache/biblehal/explode/hal-${index}.bib
28done < /var/cache/biblehal/download/hal-extract-auto-${year}.bib
29
30rm /var/cache/biblehal/explode/hal-0.bib
Note: See TracBrowser for help on using the repository browser.