# !/bin/bash 
# This command in order to make a eFrench package for windows
# with a choice of files out of this underlying structure.
# This command ist to be called in following manner
#    bash unx_pack.sh <directory>. 
# As result, a directory to be packed to build an eFrench
# package with all files neccessary to run french.sty
# correctly
# which the files are to be copied and where thy should
# have to be placed is described in file named list_unx
#
# function taking ligne to produce a copy
# tested with bash running under Ubuntu 9.10
CePaquet='/eFre4Lnx'
mkdir $1$CePaquet
mkdir $1$CePaquet/french
mkdir $1$CePaquet/french/AfasAuteur
mkdir $1$CePaquet/french/contrib
mkdir $1$CePaquet/french/contrib/french_bst
mkdir $1$CePaquet/french/doc
mkdir $1$CePaquet/french/engines
mkdir $1$CePaquet/french/initex
mkdir $1$CePaquet/french/initex/tests
mkdir $1$CePaquet/french/inputs
mkdir $1$CePaquet/french/inputs/french
mkdir $1$CePaquet/french/inputs/frozen
mkdir $1$CePaquet/french/inputs/keyboard
mkdir $1$CePaquet/french/inputs/mkindex
mkdir $1$CePaquet/french/inputs/mlp
mkdir $1$CePaquet/french/inputs/msg
mkdir $1$CePaquet/french/inputs/other
mkdir $1$CePaquet/french/MlTeX
mkdir $1$CePaquet/french/tst
mkdir $1$CePaquet/french/web
function copiefich
{
source="../../"$2
if [ "$3" = "r" ] ; then
{ but=$1"/"$2  
}
else
{ but=$1"/french/"$2 
}
fi
cp -P $source $but
}

while read -r ligne 
do
copiefich $1$CePaquet $ligne
done < list_unx

