I am having some issues with local variables after exiting a loop. The variable max ends up with the value 0, despite the code below:
max
max=0 cat
max=0 while read line do temp=$(echo $line|tr -d "\n"|wc -c) if [ $temp -gt $max ] then max=$temp echo $max fi done