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

Re: line continuation with sed



> On 13/10/2022 19:25 Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> I'm wondering if this is a zsh issue or entirely sed's fault but:
> 
> $ var=$( print -l $var | sed \
> -re 's/.../' \                                 # this is fine
> -re 's/.../'\                                  # this  throws an error 
> which I'd expect
> -re 's/.../' \                                  # this throws an error ...
> -re 's/.../' )
> 
> ... if there is a bloody space AFTER the backslash and before the 
> newline.  Thing is it's an invisible error, I just wasted the morning 
> with some sed errors which refused to be found because they were 
> invisible.

You can configure a number of editors to show this up.  In emacs,
for example, I use:

(setq-default show-trailing-whitespace t)

to show it for all modes, since it's often useful and at worst
a minor distraction.

I think other editors have similar capabilities.

pws




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