See sh(1), under "Command execution":

[...] Just to confuse things, if the posix option is turned off (see
the set command below), some special commands are very special in that
no field splitting, file globbing, nor tilde expansion is performed on
arguments that look like assignments.


Andreas

On 03/08/05, Dave Anderson <[EMAIL PROTECTED]> wrote:
> 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)"
> 
> 


-- 
Andreas Kahari

PGP: 1024D/C2E163CB

Reply via email to