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

Feature creep suggestion: make <<- more flexible



I like the idea of <<- because it makes scripts prettier by not
requiring sudden mid-script de-indentation, but since it only works
for tabs I usually end up not using it and going for grungier
workarounds like:

sed 's/^    //' << END
...
END | cmd

Is there any reason it should have to be tabs?  Why not just strip any
sequence of spaces and tabs? If backwards compatibility is an issue in
just this one tiny corner of zsh, you could make it controlled by an
option.

See, I live in a tab-hating 80-column-constrained world where tabs are
always 8 wide in case someone else uses them expecting things to line
up, but where I avoid using them myself, especially in cases like here
documents where I might be trying to generate a nearly 80 column
document from within an 80 column shell script.

In fact, I think it'd be even more useful if it just looked at the
first line to see what leading whitespace it had and stripped just
that from all succeeding lines.  That way you could have lines within
the here document that were more indented than other lines in the
output.



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