diff --git a/utils/typo.sh b/utils/typo.sh index 2139abe3..b0e3728f 100755 --- a/utils/typo.sh +++ b/utils/typo.sh @@ -5,16 +5,16 @@ #Description: apply typo rules depending on language for songs (.sg files) #Commentary: to be merge with latex-preprocessing script -for song in songs/*/*.sg; do +for song in $@; do + echo $song if grep -q "selectlanguage{english}" $song then sed -i \ - -e 's/(\s)*?/?/g' \ - -e 's/(\s)*!/!/g' \ - -e 's/(\s)*:/:/g' \ + -e 's/[\s]*?/?/g' \ + -e 's/[\s]*!/!/g' \ + -e 's/[\s]*:/:/g' \ $song; - fi; - if grep -q "selectlanguage{french}" $song + elif grep -q "selectlanguage{french}" $song then sed -i \ -e 's/\([^ ]\)?/\1 ?/g' \