Bash is anal about whitespace before and after equals signs.
How make part of an assignment go to NEXT line and be INDENTED?

This works...


(office /tmp) % more a.sh
A="1 2 3 4"
B=" "
 
for NUMBER in $A; do
           B=$B$NUMBER
done
 
echo "B=" $B
(office /tmp) % sh a.sh
B= 1234


Not if I add whitespace and indent!!!

(office /tmp) % more a.sh
A="1 2 3 4"
B=" "
 
for NUMBER in $A; do
           B=$B\
              $NUMBER
done
 
echo "B=" $B
(office /tmp) % sh a.sh
a.sh: line 6: 1: command not found
a.sh: line 6: 2: command not found
a.sh: line 6: 3: command not found
a.sh: line 6: 4: command not found
B=




How fix so long assignment lines can be indented nicely in scripts??

Chris

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to