Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
difficult alias
- X-seq: zsh-users 30624
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: difficult alias
- Date: Sun, 3 May 2026 07:23:45 -0700
- Archived-at: <https://zsh.org/users/30624>
- List-id: <zsh-users.zsh.org>
% 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