#!/bin/bash
# Affiche la documentation dans le répertoire bin
pwd=$PWD
cd $HOME/bin
ls erg-* | grep -v "~" | while read i
do
	# Bold
	# echo -e "\n\033[1m$i\033[0m"
	# retour à la normale
	# tput sgr0
	# Normal :
	echo -e "\n$i" | sed -e 's/$pwd//g' >> DOCUMENTATION
	cat "$i" | grep -v "^\#\!\/"  | while read j
	do
		test="$(echo  "$j" | grep "^# ")"
		if [ -n "$test" ]
		then
			echo -e "$j" | sed -e "s/# /\t/g" >> DOCUMENTATION
		else 
			exit
		fi
	done
done
cd $pwd
cp ~/bin/DOCUMENTATION .