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

Re: indented heredocs



Dave Yost wrote on Wed, Dec 21, 2016 at 11:29:17 -0800:
> Surely people have thought of this (Alternative 1):
> 

> 0 Wed 10:53:53 ~
> 205 Z% cat <<xx   
>   foo
>   bar
>   xx
> foo
> bar
> 0 Wed 10:53:53 ~
> 206 Z% 
> 
> but shells don’t do that.
> 

That's supported already:

       <<[-] word
              ⋮
              If <<- is used, then all leading tabs are stripped from word and
              from the document.

$ zsh -f
% cat <<-x
heredocd>       foo
heredocd>       bar
heredocd>       x
foo
bar
% 

Cheers,

Daniel



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