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
|
Rev | Line | |
---|
[2] | 1 | #!/bin/bash |
---|
| 2 | # |
---|
| 3 | # gabriel 2010/06/03 |
---|
| 4 | |
---|
| 5 | export PATH="/bin:/usr/bin:/usr/lib/biblehal" |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | year=$1; shift |
---|
| 9 | |
---|
| 10 | if [ ! -e /var/cache/biblehal/download/hal-extract-auto-${year}.bib ] |
---|
| 11 | then |
---|
| 12 | echo "Usage biblehal-explode year" |
---|
| 13 | echo " File /var/cache/biblehal/download/hal-extract-auto-${year}.bib must exist" |
---|
| 14 | exit 1 |
---|
| 15 | fi |
---|
| 16 | |
---|
| 17 | mkdir -p /var/cache/biblehal/explode |
---|
| 18 | |
---|
| 19 | index=0 |
---|
| 20 | while 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 |
---|
| 28 | done < /var/cache/biblehal/download/hal-extract-auto-${year}.bib |
---|
| 29 | |
---|
| 30 | rm /var/cache/biblehal/explode/hal-0.bib |
---|
Note: See
TracBrowser
for help on using the repository browser.