[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: while loop read file problem
From: |
Eduardo A . Bustamante López |
Subject: |
Re: while loop read file problem |
Date: |
Sat, 6 Dec 2014 15:26:26 -0600 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
This is well know, and not a bug. Please read:
http://mywiki.wooledge.org/BashFAQ/024
when you run:
command | while-loop
the 'while-loop' part is executed in a subshell (actually, both commands are).
This means that they're no longer the same process as the main shell, and the
consequence is that they do not share variables.
There are several workarounds, all explained in the Bash FAQ from Wooledge.