src/header.inc.sh.
 . gettext.sh
 VERSION=210519
 ADD_APPENDIX=$HOME/Add_appendix
 export PATH=$PATH:$HOME/Add_appendix/bin
 TEXTDOMAIN=header.inc
 TEXTDOMAINDIR="/usr/share/locale"
 clear
 function tests_header_syntax
 echo
 echo "$(gettext ' Syntax of the header.inc command in test mode if the book is already created \$0 <bookname> --t ')"
 echo "$(gettext ' Example : \$O TestBook --t ')"
 echo "$(gettext ' Second syntax command in test mode if the book is not created : \$0 --t ')"
 echo "$(gettext ' Example : \$0 --v or \$0 ? --t ')"
 echo 
 exit 0
 if test -z $1; then echo "$(gettext ' Error: input parameter is empty, see the command : header.inc ? ')"; exit -1; fi
 if [ "$1" = '?' ]; then
 if [ "$2" = "--t" ]; then tests_header_syntax; else echo "Syntax : header.inc bookame"; exit 0; fi
 fi
 if [ "$1" = "--v" ]; then echo " header.inc version $VERSION"; exit 0; echo; fi
 if [ "$2" = "--t" ]; then echo -n "Tests mode $2; "; Testsmode="true"; echo "Testmode = $Testsmode"; fi
 if [ -e ~/Add_appendix/vars/installdir.var ]
 then 
 source ~/Add_appendix/vars/installdir.var
 else
 echo -n "Current directory in $0 "; pwd
 echo "~/Add_appendix/vars/installdir.var not found in $0 command"
 echo -e "\033[47m\033[1;30m Re-install Add_Appendix ? \033[0m"
 read -s -n1 -p "inkey y/n: " Inkey; echo "$Inkey"
 if [ "$Inkey" = 'y' ]; then
 ~/Add_appendix/sbin/users_install_annex.sh Add_appendix
 #xdg-open https://fr.wikibooks.org/wiki/Auto-éditer_un_wikilivre/Annexer_\(Version_internationalisée\)/users_install_annex.sh
 exit 0
 else exit -1
 fi
 fi
 Bindir=$Installdir/bin
 Libdir=$Installdir/lib
 Mandir=$Installdir/man
 Sharedir=$Installdir/share
 Sbindir=$Installdir/sbin
 Booksdir=$Workdir/books
 Datasdir=$Workdir/datas 
 Resources=$Workdir/resources
 Testsdir=$Workdir/tests
 Varsdir=$Workdir/vars
 if [ "$Testsmode" = "true" ]; then
 echo "* Install directory = $Installdir"
 echo -e "\033[47m\033[1;30m In install directories \033[0m"
 echo " Executables directory = $Bindir"
 echo "- Library directory = $Libdir"
 echo "- Manuals directory = $Mandir"
 echo "- Share directory = $Sharedir"
 echo "- Admin directory = $Sbindir"
 echo
 echo "* Working directory = $Workdir"
 echo -e "\033[47m\033[1;30m In Working directory \033[0m"
 echo "- Books directory = $Booksdir"
 echo "- Datas directoy = $Datasdir"
 echo "- Resources directory = $Resources"
 echo "- Tests directory = $Testsdir"
 echo "- Variables directory = $Varsdir"
 fi 
 if test -e $Libdir/annex.lib 
 then if [ "$Testsdmode" = "true" ]; then echo; echo " $Libdir/annex.lib is found"; fi
 else
 echo "To continue, copy annex.lib to $Libdir"
 exit -1
 fi
 Conversions="$Datasdir/conversions.dat" 
 if [ "$Testsdmode" = "true" ] 
 then 
 echo; echo "$(gettext ' When the command tests is $Testsdir, then conversion file is recreated to ')"$Conversions
 rm $Conversions
 fi
 if test -e "$Conversions"
 then echo "$(gettext ' The conversion file is present ')"
 else 
 echo "s/%24/\$/g;s/%21/\!/g;s/%25/%/g;s/%2B/+/g;s/%3C/\\\&lt\;/g;s/%3E/\&gt\;/g;" » $Conversions
 echo "s/%5C/\\\/g;s/%B0/°/g" » $Conversions
 echo "s/%E0/à/g;s/%E2/â/g" » $Conversions
 echo "s/%E8/è/g;s/%E9/é/g;s/%EA/ê/g;s/%EB/ë/g" » $Conversions
 echo "s/%EE/î/g;s/%EF/ï/g" » $Conversions
 echo "s/%F4/ô/g" » $Conversions
 echo "s/%F9/ù/g;s/%FB/û/g" » $Conversions
 echo "s/%25/%/g;" » $Conversions
 echo "s/%28/(/g;s/%29/)/g;" » $Conversions
 echo "s/%2B/+/g;" » $Conversions
 echo "s/%3A/:/g;" » $Conversions
 echo "s/%3D/=/g;" » $Conversions
 echo "s/%5B/[/g;" » $Conversions
 echo "s/%5D/]/g" » $Conversions
 echo "s/%3B/;/g;s/%2F/\//g;s/%27/"/g" » $Conversions
 echo 's/%22/"/g' » $Conversions
 echo "s/%C3%A7/ç/g;s/%E7/ç/g" » $Conversions
 echo "s/%C3%A0/à/g;s/%C3%A2/â/g" » $Conversions
 echo "s/%C3%A9/é/g;s/%C3%A8/è/g;s/%C3%AA/ê/g" » $Conversions
 echo "s/%C3%AE/î/g;s/%C3%AF/ï/g" » $Conversions
 echo "s/%C3%B4/ô/g" » $Conversions
 echo "s/%C3%B9/ù/g;s/%C3%BB/û/g" » $Conversions
 echo "s/%C2%B7/-/g;s/%C2%AB/«/g;s/%C2%BB/»/g" » $Conversions
 echo "$(gettext ' The file conversions.dat is created or updated in file : ')" $Conversions
 fi
 if test -d $Booksdir/$1; then
 if test -e "$Varsdir/$1.var"; then source $Varsdir/$1.var; 
 else 
 echo -e "$(gettext ' \033[31m'$1' variables not found in '$Varsdir'.\033[0m ')";
 echo -n "Site=" > $Varsdir/$1.var; ls $Booksdir/$1 | grep wikibooks » $Varsdir/$1.var
 echo "Bookname=$1" » $Varsdir/$1.var 
 echo "$(gettext ' Get the suffix in project directory and put it in vars/$1.var : ')"
 if test -e "$Booksdir/$1/$1.contents"; then cat $Booksdir/$1/$1.contents; echo "Suffix=contents" » $Varsdir/$1.var
 elif test -e "$Booksdir/$1/$1.summary"; then cat $Booksdir/$1/$1.summary; echo "Suffix=summary" » $Varsdir/$1.var
 elif test -e "$Booksdir/$1/$1.compiled"; then cat $Booksdir/$1/$1.compiled; echo "Suffix=compiled" » $Varsdir/$1.var
 else echo "$(gettext ' List of links to articles to be analyzed : not found ')"
 fi
 fi
 fi 
 echo
 echo -n "$(gettext ' Test if the file $Project/$1.list, exists : ')"; echo "$Booksdir/$1/$1.list"
 if test -e "$Booksdir/$1/$1.list"
 then 
 echo "$(gettext ' Yes, the file exists. ')" 
 else 
 echo -e "$(gettext ' \033[31mNo, '$Booksdir/$1/$1.list' is not yet created.\033[0m ')"
 fi
 echo -n "$(gettext ' Test if the file $Project/$1.prj, exists: ')"; echo "$Booksdir/$1/$1.prj"
 if test -e "$Booksdir/$1/$1.prj"
 then echo "$(gettext ' Yes, the file exists. ')" 
 else echo -e "$(gettext ' \033[31mNo, '$Booksdir/$1/$1.prj' is not yet created.\033[0m ')"
 fi
 if test -n $1 
 then echo; echo -e -n "$(gettext ' \033[33mContents in the project directory : ')"; echo -e "$Booksdir/$1 \033[0m"
 ls -al $Booksdir/$1 
 fi
 echo; echo -n -e "$(gettext ' \033[33mVariables in the project directory : ')"; echo -e "$Booksdir/$1 \033[0m"
 source $Varsdir/$1.var
 cat $Varsdir/$1.var
 echo; echo -n -e "$(gettext ' \033[33mLink to the local html book : ')"; echo -e "$Booksdir/$1 \033[0m"
 ls -1R $Booksdir/$1/$Site | tail -n 2 | sed "s/:/\//g" | tr -d "\n"; echo; echo
tests/header.inc/tests_header.inc.bash.
VERSION=210522
clear
 pwd > pwd.txt
 if cat pwd.txt | grep ~/Annexer; then Workdir=~/Annexer; elif cat pwd.txt | grep ~/Add_appendix; \
 then Workdir=~/Add_appendix; else echo "Workind directory not found"; exit -1;fi
 rm pwd.txt 
 source $Workdir/vars/installdir.var 
 echo " test_header.inc.bash version = $VERSION"
 sleep 2
 ./header.inc.sh --v
 echo;echo " wait for 2 sec"
 sleep 2; echo "----" 
 echo -e "\033[1;33m Control header.inc.sh in the local test directory \033[0m" > text-control.txt 
 echo -e "\033[1;33m Please check that the comment line does not contain an command \033[0m" » text-control.txt
 echo -e "\033[1;33m ---- \033[0m"
 grep -n -e "#T\|#O\|#P" header.inc.sh » text-control.txt
 more text-control.txt
 echo; echo -e "\033[47m\033[1;30m Continue ? \033[0m"
 read -s -e -n 1 -t 60 -p "y/n ? : " Inkey;echo
 if [ "$Inkey" != 'y' ]; then echo " Inkey is not yes, or time out after 60 sec, exit from $0"; exit 0;fi
 echo "Command ./header.inc.sh - --t to verify environnement variables"
 echo " in test mode with first param empty"
 ./header.inc.sh - --t
 echo;echo " wait for 2 sec"
 sleep 5; echo "----"
 echo "Command ./header.inc.sh without parameter"
 ./header.inc.sh
 echo;echo " wait for 2 sec"
 sleep 2; echo "----"
 echo " All tests whith parameter --t" 
 Inkey=1
 for i in 'seq 1 9'
 do 
 cat $Workdir/tests/sitelist.txt; echo
 echo -e "\033[47m\033[1;30m Choose the site number to test \033[0m"
 read -s -n1 -p "inkey number 1 to 9 : " Inkey; echo;
 if [ "$Inkey" = "1" ]; then ./header.inc.sh LivreTest --t
 elif [ "$Inkey" = "2" ]; then ./header.inc.sh Hélices_de_navires_à_déplacement --t
 elif [ "$Inkey" = "3" ]; then ./header.inc.sh TestBook --t
 elif [ "$Inkey" = "4" ]; then ./header.inc.sh Mkd_\(Extracteur_de_documents\) --t
 elif [ "$Inkey" = "5" ]; then ./header.inc.sh Faire_fleurir_le_sel --t
 elif [ "$Inkey" = "6" ]; then ./header.inc.sh Faire_sa_fleur_de_sel --t 
 elif [ "$Inkey" = "7" ]; then ./header.inc.sh Guide_to_Unix --t
 elif [ "$Inkey" = "8" ]; then ./header.inc.sh Tests_de_la_capacité_des_batteries_d%27accumulateurs
 elif [ "$Inkey" = "9" ]; then ./header.inc.sh LivreTest --t
 else echo "$inkey local url of site not found"; exit 0
 fi
 done
List to tests header.inc.
sitelist.sh
echo "sitelist to test annex programs"
echo -e "\033[47m \033[1;32m Books with Contents or Summary \033[0m"
echo " 1 - https://fr.wikibooks.org/wiki/Utilisateur:Goelette_Cardabela/Sandbox/LivreTest/Contenu --t"
echo " 2 - https://fr.wikibooks.org/wiki/Hélices_de_navires_à_déplacement/Sommaire --t"
echo " 3 - https://en.wikibooks.org/wiki/User:Goelette_Cardabela/sandbox/TestBook/Content --t"
echo " 4 - https://fr.wikibooks.org/wiki/Mkd_\(Extracteur_de_documents\)/Sommaire --t"
echo -e "\033[47m \033[1;32m Collections \033[0m"
echo " 5 - https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_fleurir_le_sel --t"
echo -e "\033[1;31m Same book second title \033[0m"
echo " 6 - https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel --t"
echo " 7 - https://en.wikibooks.org/wiki/Wikibooks:Collections/Guide_to_Unix --t"
echo " 8 - https://fr.wikibooks.org/wiki/Utilisateur:Goelette_Cardabela/Compilations/Tests_de_la_capacit%C3%A9_des_batteries_d%27accumulateurs"
echo " 9 - https://fr.wikibooks.org/wiki/Utilisateur:Goelette_Cardabela/Compilations/LivreTest --t"
echo -e "\033[47m \033[1;32m Atypical variants \033[0m"
echo -e "\033[1;31m Copy the line (Ctrl-Shift-C) and execute in terminal (Ctrl-Shift-V) \033[0m"
echo " xdg-open https://fr.wikibooks.org/wiki/Auto-éditer_un_wikilivre/Auto-référencer/LivreTest/LivreTest.compilé"
echo " xdg-open https://fr.wikibooks.org/w/index.php?title=Auto-éditer_un_wikilivre/Auto-référencer/LivreTest/LivreTest.compilé&action=edit"
text list for tests.
Sitelist.txt