Re: difficult alias
Ray Andrews <[email protected]> Sun, 3 May 2026 15:11:00 -0700
| Newsgroups | gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user |
|---|---|
| Message-ID | <[email protected]> |
On 2026-05-03 13:50, Mark J. Reed wrote:
> 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.
That is really clever. Come to think of it, there could be cases where
it could have that sort of utility.