Fred67
18th September 2002, 16:05
I made a shell which could perhaps interest somebody.

We often use this shell to have examples of use of baan fonctions, for better understanding.
The shell searches the chain in baan scripts, report scripts and includes. For example if you want to have and example for the function "shell", this shell displays the scripts where is used the word (or function).

The limits are : no use of special caracters such as "(" or "$".
This shell is written for Baan IV C4, I think the directories in Baan ERP will be different. Then this shell won't function correctly for ban REP.

Use : shell_name chain_to_search package_combination

I attach a text file which gives an example of results (open with a text editor, not IE)
I hope this will be usefull for you.


THE SCRIPT
------------------
Explanations :
Indiquer une chaine de caracteres recherchee et le package (c4, stnd, prod}! : means "Give the chain to search and the package (c4, stnd, prod).

# find-fonction
: ${1?"Indiquer une chaine de caracteres recherchee et le package (c4, stnd, prod}!"}
: ${2?"Indiquer une chaine de caracteres recherchee et le package (c4, stnd, prod}!"}
. /administration/setenv # sets variables such as $BSE
cd $BSE/application

for j in `find *$2 -name "[rpi]*"| grep -v "\-$"`;
do
grep -l $1 $j > /tmp/tutu
if test -s /tmp/tutu
then
echo "\n\n------------------------------------------------"
fi
grep -l $1 $j
grep $1 $j
done