Something's screwy here, using the 'set -A' command in /bin/sh on
3.7-release. AFAICT the complicated file-match expression should (in
this case) produce the same results as the simple one, but it doesn't
seem to match at all when used in this script -- but does produce the
expected result when cut-and-pasted to a command line.
Any constructive comments would be greatly appreciated.
Dave
The results:
match = '/var/log/pf/103790/*'
files[0] = '/var/log/pf/103790/ne3.in.block.destIP'
files[1] = '/var/log/pf/103790/ne3.in.block.destPort'
files[2] = '/var/log/pf/103790/ne3.in.block.srcIP'
match =
'/var/log/pf/103790/+([a-zA-Z])+([0-9]).@(in|out).@(block|pass).@(destIP|destPort|srcIP)'
files[0] =
'/var/log/pf/103790/+([a-zA-Z])+([0-9]).@(in|out).@(block|pass).@(destIP|destPort|srcIP)'
The script:
#! /bin/sh
function DoIt {
set -A files $1
echo "match = '$1'"
typeset -i idx
idx=0
while [ idx -lt ${#files[*]} ] ; do
echo "files[$idx] = '${files[$idx]}'"
idx=idx+1
done
return 0
}
DoIt "/var/log/pf/103790/*"
echo ""
DoIt
"/var/log/pf/103790/+([a-zA-Z])+([0-9]).@(in|out).@(block|pass).@(destIP|destPort|srcIP)"