RE: Variables in scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
> 
> I have a simple script:
> 
> #!/bin/sh
> 
******
 change=0 #should be changed=0
*******

> 
> while [ $changed -eq 0 ];
> do

*******
> 	changed=1 #should be $changed=0
*******

> 	echo $changed
> done
> 
> echo $changed
> exit
> 
> When I come to the last echo $changed, it's back to 0.  Any 
> idea why that is?  This works find on Solaris???
> 
>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.772 / Virus Database: 519 - Release Date: 10/1/2004
 

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux