Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Multiline Anonymous Literal Strings


Anyone know of a way to compose a long literal string without doing
something like this?

   myvar="this is a really long string so long that I need to break"
   myvar="$myvar up the assignment"

In C, contiguous quoted strings are implicitly joined at a compile time:

   printf("This is a really long literal strong that will extend "
          "beyond 80 characters.\n");

In Perl and other languages, concatenation operators like ., &, and +
are available.

One application of this problem's solution is assigning aliases when the
command is longer than my terminal window.  I'd rather not introduce a
variable to make my code look nice.  I would like to be able to clean up
the following:

   alias mycommand="prog long list of options so long that it will reach
beyond the edge of the screen"

Chris Johnson

Messages sorted by: Reverse Date, Date, Thread, Author