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

Re: difficult alias





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.





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