Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: difficult alias
- X-seq: zsh-users 30632
- From: "Mark J. Reed" <markjreed@xxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: difficult alias
- Date: Sun, 3 May 2026 16:50:05 -0400
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=0xGcSHdxGMKfiu2733xQyki1vxLNkyJRn/FKft2FTX8=; fh=D6X9xIaVjTSxb6gwuCseglo0uxyISp24IsyxMp5sRU4=; b=Nn4e8YGhRnf7iaOdLqfTrV0qHhHOQOff8Y4FCcdIF7f39jjKIjZv40rou61iYi9RbU u7Py11tzPuuWbwQdBMDLQP13rx8B63+VPJRXSoB3zIhFVtLtl7xpwFfDvSHHxTKmj5Tl 3tcsmZnng5BR94f1ZqwWeb7LOikYmy8okws/6jzN50FgFQH9JjjWnVkVy+ZaEapViW2Q kWtAGc/7FT7F1ARCiNKjH+9xzOtlZfpd7dmU9M+vAprdZ1Q7fJCDazor1FEP8bjb0Yb4 DX4mANbG2VFhxAIcnlKH2TS6PIxV8UzM51PF4P7jJgFn9qheGEPuA/I24vyGNWYGtIB4 +auQ==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1777841417; cv=none; d=google.com; s=arc-20240605; b=CIGaMsZNS4D7njKJAniQnlDD0jwvzD1U9JBb7F1MEc677xusXi6vWl4nDndlhRgWjM UGEDmw0MvWCt2639POA3vmMMCXjUYu2722V5lnr77Tjppjxfyd4clLvh2zlyenuHmJvI QFi6TAQgSOhscfj6/3ldWxo7iPPfQvpV+aR85uXZvghnmPqx7EKRjvAXZQX8NkDRPizs QzEWJu2IRWubemx1F9ipKb+jDwjGRWZ130fLrKgw3w47O6NDuS2dwcQPVwJP8NiL4mao kSRh2iX9jsGa6BSEQGlweCcOa899NJfeOoWZvneTFYZ+MyOG5MqOjms9cpSE5AS2KWUi wuXQ==
- Archived-at: <https://zsh.org/users/30632>
- In-reply-to: <7feea94a-f788-4f12-8dd3-4fee29541f9f@eastlink.ca>
- List-id: <zsh-users.zsh.org>
- References: <acec1e04-269d-4828-b3ba-6d0a88c96fb7@eastlink.ca> <afeheq9ihjP78rmH@ikki.ket> <7feea94a-f788-4f12-8dd3-4fee29541f9f@eastlink.ca>
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.
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author