[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: value of variable hasn't changed after while loop
From: |
Chet Ramey |
Subject: |
Re: value of variable hasn't changed after while loop |
Date: |
Thu, 7 Nov 2002 08:24:13 -0500 |
> Why can't I change the value of variable after while loop?
>
> #!/bin/sh
>
> A=3D"cde"
> cat /etc/passwd | while read line; do
> A=3D"abc" && echo $A
> done
Read the Bash FAQ, question E4.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Chet Ramey, ITS, CWRU chet@po.CWRU.Edu http://cnswww.cns.cwru.edu/~chet/