begin  quoting Christian Seberino as of Tue, Mar 01, 2005 at 06:01:09PM -0800:
> Bash is anal about whitespace before and after equals signs.
> How make part of an assignment go to NEXT line and be INDENTED?
> 
[snip]
> How fix so long assignment lines can be indented nicely in scripts??

   B="$B\
      $NUMBER"

However... that doesn't do quite the same thing.

First, don't use tabs to indent if you want to limit line length. Indent
by three or four, as most of the time, tabs display at 8, and almost
always print at 8.

Second, use temporary variables.

  A1=$FOO_BAR_BAZ_WUZZY
  A2=$BAR_BAZ_FOO_BEAR
  A3=${A1}${A2}
  ANSWER_BLAH_BLAH_BLAH=$A3
  
Third, build up the answer gradually.

  ACC="$A1$A2 $A3 $A4 $A5 $A5 $A5 $A5 How now brown cow"
  ACC="$ACC What a fine looking musket you have there $A7 $A6"
  ACC="$ACC $A9 $A8 Audi, for when you have too much money for a subaru"
  ACC="$ACC blah blah blah blah blah blah"
  ANSWER=$ACC

-Stewart "Programming in bash considered harmful and arrogant" Stremler
-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to