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

Re: Multiline Anonymous Literal Strings



Chris Johnson <cjohnson@xxxxxxxxxx>:
> 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"

[snip]
myvar="this is a really long string so long that I need to break "
myvar+="up the assignment."
print ${myvar}
[snap]

[...]
> 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"

[snip]
pa=(
  -l
  one
  two
  three
  four
  five
  six
)
alias p="print ${pa}"
[snap]

Regards, Frank



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