Prise en compte d'un argument positionnel pour restreindre la recherche des programmes à compiler à un répertoire

This commit is contained in:
Benjamin Bohard 2016-03-01 11:44:10 +01:00
parent 08eef1bb14
commit 99de52f66b
1 changed files with 7 additions and 1 deletions

View File

@ -4,8 +4,14 @@ function path_to_name {
PROGRAMPATH=$1
echo ${PROGRAMPATH//\_/\ }
}
if [ "$1" = '' ]
then
rep='.'
else
rep="$1"
fi
for directory in $(find . -name programme -type d); do
for directory in $(find "$rep" -name programme -type d); do
cat > programme_options.tex <<EOB
\\newcommand{\\formation}{$(path_to_name $(basename ${directory%/programme}))}
\\newcommand{\\dossier}{$directory}