From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 5A0C82480A for ; Tue, 4 Jun 2024 20:13:29 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1717524809; b=lC+5/vEd1M3juvIOSNPO7bUuY9As0ZDlbrIbXmajEWwOQ0uXGWWz2T6oc/HMmCISV98FwwmYZ9 4UmTterWAtRKNP4J6VXX6IV/NOc8GD/OMr/bdwvvsiuEZfyODchG21dAOfXwPyLaq/0vzojCNV e4QvEFL+bIXST/knKGdhnnJiTXENM+F4wt6w30n/+7SLXN+qG1vVok7Lh7/ZHvCPY4NlSUQehf 8n4xRadVIOYo5uzbZqLA+eZ12M/GTFF/MQ4cZMqhm6pmaysIU2WdTAB/Q2OySpERDAaCBuxf3T Nd5btGOqrT5GhMergLDE+Ux4+LRLyfbeONnYQwycA/ZGUg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f181.google.com) smtp.remote-ip=209.85.208.181; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1717524809; bh=vALmF390W2coZTSrKyT/pmrage11J2FVwU3eYXGY3a8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=mfIC3vTEbltz3vhZ3BUWu5UyLpFOoWDJR/GtNfAMqqLDQxFPphn9T5/arGRlyEy3aydzEH2e/I Kf+u8bWA7IPA2uZ27yVB9id7COEuoaa8v5URDvPf9C6jbq7zA8i3z4++5B64qE13xsQVugMyE3 7bHW16JfxToG7yro/I3VRupKfXZLEEH6if0pMMObdc0jCNGpttePyhpoTFEJBbDypwL42NJUTO AAqZDnstR2ouqSE6j9YeqTh/V+nM9xMFf6TXP8gJWQ83EfFn08qe9c1+6FFfSRdcnHJCAUnj8B tTB0Xr8P/+1NvdPDKapMt3NR5O/yh2RKS76f0XdQ2Gp1dg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=QJIdbvryekmC72B6sdeqIJEwbSiZJK1RFtXNMGruhII=; b=rblMqEROPqj2+0qBdiYsEK9NcT eGSRKEiDjqEGv/k4czdaEBk7JRx65oY8EyxfcKhvTs5UssbAxHTQ4HruYM4KxNSJObNLSxUNCpH4r p/Q0iX7PCXP6ECuRo7aEbRbrSXIr9BwMSDzo0gaiYgH16d36TwWOaSn36qxsZEnQY3B2yFXDqED8H h3mSdY3Em7Bp0pyKYkuGE+nBI58ZsgAyJXiukkCC0QQdWvPY2URALTupRFqyU6fnOjGqQ2rp/G/dS Da8tK2OnfuBtbQmf3QUIZzh85PnvX7nRx5sDbqRO7dhEGD4cMAfUnTBVyCoWhO0X15V+3M+UqZfWF cbUvFw2g==; Received: by zero.zsh.org with local id 1sEYf3-000IhC-7o; Tue, 04 Jun 2024 18:13:29 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f181.google.com) smtp.remote-ip=209.85.208.181; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f181.google.com ([209.85.208.181]:47499) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1sEYeH-000Ht1-2O; Tue, 04 Jun 2024 18:12:42 +0000 Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2eaafda3b5cso14232041fa.3 for ; Tue, 04 Jun 2024 11:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717524760; x=1718129560; darn=zsh.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=QJIdbvryekmC72B6sdeqIJEwbSiZJK1RFtXNMGruhII=; b=IQJ/Wn32xCEDa/3/HwjAHk5HALb34xiIYDAtfigg+Rx507/4sSXJA/mlXsz4hESPVk n/5daV0GWPjYjxuiopzdv1Kg7hQFI45AvcUIjiaizLYo0/Qur5dpzbbX7WcAL1AzWzvG 6mfNLsIvPv+Q0zywBLfOXnPkOI4aMh663C0hKWfuszG4hDbZxtIIs+u4kxlBQpouQ9JP tpXAH1YTKdf2E/5VaalBzPzevlW71PEfScNCWk+HSBaULlJ+Wn0IlfEWnVJR2rgCZAtS eAFwZh5+QeLoipPxVwj4kINFSeekXC765mNSi8sZ5B1dC4eAsSmuQ7XqZYA1/LcSzzve atZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717524760; x=1718129560; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QJIdbvryekmC72B6sdeqIJEwbSiZJK1RFtXNMGruhII=; b=CkjzTFBFDsDqyM8mNO+dm1So0YyJ3CxIzcs+Tmbr3AblKHQKGDT+zFw5yMScwAFeb0 9CI5e4jYgseJHa4QkEx0/jx8gWmt02X5zTL+nALGcUmDEgfcpzRSrwLqp28Fpqe4/Xoj RIE2knKxHHdFLw6WkV28GBvNJowLOQeFAioAmSltirZt1p1i7Gr/jYx+04bpT2Ynb/81 XURrJXYbXDq20ih0i0ko1AhIiN6rohi5p3/rUH9LiVfjqw8ZIWPov4H6/y2jDWnTQsQq 2BEE2ZXAauMTNIRZmV3oH4lWQECcief/B6C6DptnxA3SXXYZOvfgryJ0dzvyuNgZPkMa 6oHw== X-Gm-Message-State: AOJu0YzFdj6FdBkltSohY9atk2Vif8jczE8ldiEIOfyRQ/dHqQRjUMzM f7ZNeM0fA7hRllYofKDbMRZZHZkbisYFf9r7eoMzr/lGmUnOOW9+/4SXa3cmgeiS+JHsP2sXGzh HurFW7Lj3OHUna0Oik4wiWE9YV9b01A== X-Google-Smtp-Source: AGHT+IFijD7VxlgG1Di4Hf5dovOtzOLicvQc96rm4Bh9t6RDKHPD5Vakm8HnAoYjxiBC4mbc8vLMaMw/8FJOkY2xD38= X-Received: by 2002:a2e:804b:0:b0:2e5:685a:cd24 with SMTP id 38308e7fff4ca-2eac798a96dmr384441fa.6.1717524759482; Tue, 04 Jun 2024 11:12:39 -0700 (PDT) MIME-Version: 1.0 References: <32c690d4-fe7f-4d89-ac99-829fa64cca15@eastlink.ca> In-Reply-To: <32c690d4-fe7f-4d89-ac99-829fa64cca15@eastlink.ca> From: "Mark J. Reed" Date: Tue, 4 Jun 2024 14:12:28 -0400 Message-ID: Subject: Re: history puzzle To: Zsh Users Content-Type: multipart/alternative; boundary="0000000000002e9a61061a1465d6" X-Seq: 29997 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --0000000000002e9a61061a1465d6 Content-Type: text/plain; charset="UTF-8" What's "history -m"? Doesn't that just look for items in the history containing "-m"? "Word" sounds like you're reading about expansions, as in: !! - most recent command !!:$ - last word of most recent command !!:^ - same as :1, first argument word of most recent command !!:0 - just the command name of most recent command Mark J. Reed On Tue, Jun 4, 2024 at 14:01 Ray Andrews wrote: > Trying to do fancier things with history I'm clearly not understanding > something. Doc says '^' is first word in a history entry and '$' is the > last. But: > > % history -m "^" 1 # Shows everything > % history -m "^nosuchstring" 1 # Also shows everything > % history -m "$" 1 # Shows nothing > > ... so I'm obviously missing something. > > --0000000000002e9a61061a1465d6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
What's "history -m"? Doesn't that just = look for items in the history containing "-m"?

"Word" sounds like you're re= ading about expansions, as in:

!! - most recent command=C2=A0
!!:$ - last wo= rd of most recent command=C2=A0
!!:^ - same as :1, f= irst argument word of most recent command=C2=A0
!!:0= - just the command name of most recent command

Mark J. Reed <markjreed@gmail.com>


On Tue, Jun 4, 2024 at 14:01 Ray Andrews <rayandrews@eastlink.ca> wrote:
=20 =20 =20
Trying to do fancier things with history I'm clearly not understanding something.=C2=A0 Doc says '^= 9; is first word in a history entry and '$' is the last. But:

% history -m "^" 1=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 # Shows everything
% history -m "^nosuchstring" 1=C2=A0=C2=A0=C2=A0 =C2=A0 # A= lso shows everything
% history -m "$" 1=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 # Shows nothing

... so I'm obviously missing something.=C2=A0

--0000000000002e9a61061a1465d6--