#!/usr/bin/ksh # program smenu_list_shortct_cat.ksh # date : 2006 Jun 30 # Author : B. Polarski # # This program will read addpar.sh and generate the list of shortcuts per category if [ ! -f $SBINS/addpar.sh ];then echo "Ach... addpar.sh is Missing in action !, calls the Marines" exit fi NAWK=${NAWK:-/bin/awk} cat $SBINS/addpar.sh | $NAWK 'BEGIN { i0=0 ; i1=0 ; i2=0 ; i3=0; i4=0 ; i5=0; i6=0; i7=0; i8=0; i9=0; ia=0; ib=0} { if ( $0 ~ /\#[0-9ab]\#/ ) { if ( $3 == "#0#" ) { TB0[i0]=substr($2,1,index($2,"=")-1); i0++; } else if ( $3 == "#1#" ) { TB1[i1]=substr($2,1,index($2,"=")-1); i1++; } else if ( $3 == "#2#" ) { TB2[i2]=substr($2,1,index($2,"=")-1); i2++; } else if ( $3 == "#a#" ) { TBa[ia]=substr($2,1,index($2,"=")-1); ia++; } else if ( $3 == "#3#" ) { TB3[i3]=substr($2,1,index($2,"=")-1); i3++; } else if ( $3 == "#4#" ) { TB4[i4]=substr($2,1,index($2,"=")-1); i4++; } else if ( $3 == "#5#" ) { TB5[i5]=substr($2,1,index($2,"=")-1); i5++; } else if ( $3 == "#b#" ) { TB5b[ib]=substr($2,1,index($2,"=")-1); ib++; } else if ( $3 == "#6#" ) { TB6[i6]=substr($2,1,index($2,"=")-1); i6++; } else if ( $3 == "#7#" ) { TB7[i7]=substr($2,1,index($2,"=")-1); i7++; } else if ( $3 == "#8#" ) { TB8[i8]=substr($2,1,index($2,"=")-1); i8++; } else if ( $3 == "#9#" ) { TB9[i9]=substr($2,1,index($2,"=")-1); i9++; } } } END { printf " |-------------------------------------------------------- |\n" ; printf " | SMENU SHORTUCTS SUMMARY (vsl for more info) |\n" ; printf " |-------------------------------------------------------- |\n" ; printf "\n\nAdministrative and miscellanous : " for (i=0;i