Re: difficult alias

"Mark J. Reed" <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user
Message-ID <CAA=-s3x4nz2bYFMxgKmCuuuG-dXXHfpXovFMFNQ6t5xvtY69WQ@mail.gmail.com>
Also as a function you can just supply the value as a parameter instead of
hard coding the use of $var. you could even default to a predefined named
variable if no parameter is specified, e.g.

tst() {
    fold -sw 80 <<<"${1:-$var}" | sed '...'
}

Which will operate on whatever you pass to it but if you don't pass
anything will use the value of $var.


Mark J. Reed <[email protected]>

On Sun, May 3, 2026 at 16:29 Ray Andrews <[email protected]> wrote:

>
>
> On 2026-05-03 12:26, Klaus Ethgen wrote:
> > Hi,
> >
> > Am So den  3. Mai 2026 um 15:23 schrieb Ray Andrews:
> >> % 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
> > Is it just me or are you using an unquoted ";"?
> I gave up trying to fix it.  There's three levels of quotes as it is.
> As Eric said, just make it a function and there's no issue.
>
> >
> > Regards
> >     Klaus
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.