sorry i can't include the previous text, i'm having to type this
into a browser (ack!).

  regarding why there is this odd feature about variable scope in
the bash shell, i suspect it's because it has the same feature as
the korn shell regarding variables and loops.

  in a normal loop in ksh, all variables are at the current level
and behave normally.  however, the instant you incorporate I/O
redirection into a loop with one of:

        cmd | loop ...
        loop ... | cmd
        loop ... > file

and so on, things change. the loop commands will now (at least in ksh)
be executed in a pseudo-subshell, not a real subshell.

  a pseudo-subshell has read access to all variables at the current
level, but not write access (hence the "pseudo" qualifier).  that would certainly 
explain what's happening in the example that's been
presented. 

comments?

rday



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to