Changeset 101 for trunk/bibopa.sh


Ignore:
Timestamp:
04/26/10 14:12:15 (14 years ago)
Author:
pinsard
Message:

improve environnement definition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bibopa.sh

    r100 r101  
    2222# 
    2323# 
    24 # Each entry in the same input file must follows the same order for authors  
     24# Each entry in the same input file must follows the same order for authors 
    2525# except the first one. 
    2626# 
    27 # With ``fs`` in option order you will correctly process raw entry with  
     27# With ``fs`` in option order you will correctly process raw entry with 
    2828# firstname and surname in this order for authors except the first one. 
    2929# 
     
    137137# 
    138138# should use iconv instead of recode 
    139 # for portability issue but not found yet the "flat" fonctionnality in  
     139# for portability issue but not found yet the "flat" fonctionnality in 
    140140# iconv 
    141141# 
     
    197197#   * bug fix : unclosed date tag 
    198198#   * trouble with flat conversion for id building ... 
    199 #   * remove interactivity at then end (allowing redirection of stderr and  
     199#   * remove interactivity at then end (allowing redirection of stderr and 
    200200#     stdout) 
    201201#   * strip blank lines 
     
    333333# default 
    334334lang=en 
    335 order="fs" # firstname surname 
     335# fs mean "firstname surname" 
     336order="fs" 
    336337# 
    337338minargcount=6 
     
    348349do 
    349350   case ${1} in 
    350       -i) # filein 
     351      -i) 
    351352         filein=${2} 
    352353         shift 
    353354      ;; 
    354       -t) # type 
     355      -t) 
    355356         type=${2} 
    356357         shift 
    357358      ;; 
    358       -o) # order of firstname surname in bibtex file 
     359      -o) 
     360         # order of firstname surname in bibtex file 
    359361         order=${2} 
    360362         shift 
     
    372374         exit 0 
    373375      ;; 
    374       *) # other choice 
     376      *) 
     377         # other choice 
    375378         echo "eee : unknown option ${1}" 
    376379         echo "${usage}" 
     
    378381      ;; 
    379382   esac 
    380    shift # next flag 
     383   # next flag 
     384   shift 
    381385done 
    382386unset usage 
     
    392396# 
    393397case ${type} in 
    394    raw) # file like data/biball.txt 
     398   raw) 
     399      # file like data/biball.txt 
    395400      fileraw=${filein} 
    396401      fileou=$( basename ${filein} .txt).xml 
    397402   ;; 
    398    mailbody) # file like data/mail2007-04-25T08:58:16Z.txt 
     403   mailbody) 
     404      # file like data/mail2007-04-25T08:58:16Z.txt 
    399405      fileraw=/tmp/$(basename ${filein}).raw 
    400406      fileou=$( basename ${filein} .txt).xml 
     
    409415      #read a #++ if debug 
    410416   ;; 
    411    bibtex) # file like data/petitpoly.bib 
     417   bibtex) 
     418      # file like data/petitpoly.bib 
    412419      fileraw=/tmp/$(basename ${filein}).raw 
    413420      awk -f join_endcomma.awk ${filein} > ${fileraw} 
     
    771778         refid=${refid}_${num} 
    772779         hasauthor=1 
    773           
     780 
    774781         cat <<EOF >> ${fileou} 
    775782<biblioentry xml:id="${refid}"> 
     
    866873            echo "eee: Journal not found " 
    867874            echo "${endline}" 
    868             # uncomment next line for debug  
     875            # uncomment next line for debug 
    869876            # set # ++ debug 
    870877            exit 1 
     
    883890 
    884891EOF 
    885          fi # end of if jfound empty (ie not an article) 
     892            # end of if jfound empty (ie not an article) 
     893         fi 
    886894         if [ "${jfound}" != "" ] 
    887895         then 
     
    968976                  conftitle=${endline%%,*} 
    969977                  endline=${endline#*,} 
    970                   confdates=${endline%%,*} # day(s) month 
     978                  # day(s) month 
     979                  confdates=${endline%%,*} 
    971980                  endline=${endline#*,} 
    972                   confdates="${confdates}, ${endline%%,*}" # day(s) month and year 
     981                  # day(s) month and year 
     982                  confdates="${confdates}, ${endline%%,*}" 
    973983                  confdates=$( cleanname "${confdates}" ) 
    974984                  endline=${endline#*,} 
    975                   confaddress=${endline%%,*} # Town 
     985                  # Town 
     986                  confaddress=${endline%%,*} 
    976987                  endline=${endline#*,} 
    977                   confaddress="${confaddress}, ${endline%%,*}" # Town and country 
     988                  # Town and country 
     989                  confaddress="${confaddress}, ${endline%%,*}" 
    978990                  confaddress=$( cleanname "${confaddress}" ) 
    979991                  endline=${endline#*,} 
     
    10651077 
    10661078EOF 
    1067          fi # end of if jfound not empty 
     1079            # end of if jfound not empty 
     1080         fi 
    10681081         unset title 
    10691082         unset vol 
     
    10761089      echo "</bibliography>" >> ${fileou} 
    10771090   ;; 
    1078 esac # end of case bibtex vs other for processing 
     1091# end of case bibtex vs other for processing 
     1092esac 
    10791093 
    10801094xml val --err \ 
Note: See TracChangeset for help on using the changeset viewer.