#!/bin/csh
# file: ads-correct-bib-all = correct all ADS bib files
# last: Oct 11 2019  Rob Rutten  Deil 
# last: Oct 13 2019  Rob Rutten  Deil

# warning
echo " ===== ads-correct-bib-all takes time"

# copy /ads/bibraw to tmp
cp -upr ~/rr/www/bibfiles/ads/bibraw /tmp
cd /tmp/bibraw

# execute there (these go in place hence first copy to /tmp)
find . -name '*.bib' -exec ads-correct-bib {} \;
back

# shift results to ads/bib
mv /tmp/bibraw/*  ~/rr/www/bibfiles/ads/bib/.

# now zip 
echo " ===== zip the abs and bib collections"
cd ~/rr/www/bibfiles/ads
zip -r bib.zip bib
back

# concatenate all bib files 
find ~/rr/www/bibfiles/ads/bib -name '*.bib' -exec cat {} > ~/rr/www/bibfiles/bigbib/adsfiles.bib \; 

# renew bibfiles content in UU for weblinks
cd  ~/rr/www/bibfiles
echo " ===== renew content of dir bibfiles at UU"
sshcleanrrdiruu
back

# confirmation
echo " ===== ads-correct-bib-all done" 
