• Utilisation d'un tableau en shell
intfstd=(STD18 STD22 STD25 STD26 STD39 STD39B)
 
for i in ${intfstd[@]}
 
    do
    .....
    done
 
${#inftstd[*]} = nombre d'occurence (ici 6)
  • Astuce pour simuler un tableau en 2D
TAB='/etc/httpd/conf;apache_conf.tar.7z /etc/httpd/conf.d;apache_conf_d.tar.7z'
 
compression()
{
for field in ${TAB}
do
REP=$(echo ${field} | cut -d ';' -f 1)
FILE=$(echo ${field} | cut -d ';' -f 2)
tar cf - ${REP}/ | 7za a -t7z -mx9 -p${PASS} -si ${PUSH_DIR}/${FILE}
done
}