[SlugBug] bash script help

David Holden dh at iucr.org
Thu Dec 17 14:25:36 GMT 2009


On Thursday 17 December 2009 14:00:51 Alan Dawson wrote:
> Hi,
> 
> I'm obviously having a senior moment here but
> 
> I have a bash script
> 
> http://pastebin.com/f2c827762
> 
> that looks for lines like
> 
> size=1024M
> size=10G
> 
> in a file, loops over them, converts the gigs  to megs and sums them.
> 
> Within the loop the values increase properly,
> 
> but when the loop terminates it returns the values from outside the loop
> 
> help!
> 

This may be the reason:-

http://www.nucleardonkey.net/blog/2007/08/variable_scope_in_bash.html

Dave.



More information about the SlugBug mailing list