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

difficult alias




 % var="now is the time"

%  alias tst='echo $var | sed '\'s/the/THE/g\'''

... works.  But:

% alias tst='echo $var | fold -sw 80 | sed '\':a;N;$!ba;s/\n/\n    /g\'''
zsh: command not found: N
zsh: now is the time not found

... can that alias be repaired?  The command run directly is fine, but the obscure stuff at the beginning of the 'sed' doesn't want to be aliased.  zsh seems to take the >
:a;N;$!ba;< stuff as not being part of the sed.  AI recommended that BTW, I have no idea what it means, but it seems to make >\n\n   < possible which it wouldn't otherwise be.  Unless there's a  better way entirely ...

It just moves a block of text that's otherwise unwrapped into a nicer display: word wrap at 80 columns and spaced off the left margin by four chars.  Frivolous but I like it.






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