From mboxrd@z Thu Jan 1 00:00:00 1970 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, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14247 invoked from network); 12 Oct 2023 18:52:28 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Oct 2023 18:52:28 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1697136748; b=qPnLbFT7lw0FN9tLS3mJUTc+4KEQa2w0P7j9zU2j53FZEOdImJAG4lB1xCegGN9i9DZbmh2DnO JCxVYRcg8FJRsZuHI1HY5x94SIGrGAQf50BaaGnZoK9mM8na6OZwvc1wjqGVW0vFnN6oraPM1o XWCywrxTS8sHEUHUPUe2S22XUoiMi5aDsTy92PQTjvdTF59WhGvKE+Vrznx6FP+cW2aYpkrzxJ 6wmZjTK26uivJI2EuCjL3PInNqVyPPE7AngcHSjYXMQ8aZkYIH4cZ5ajV1YGkDBDuwY8sYEVab 7jF+qRkKpUBTrFT1BWe7QyniyAuh8HrNbeXNF0OvD+zC4w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f43.google.com) smtp.remote-ip=209.85.208.43; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1697136748; bh=T+WgZa/zJdk/n3G0UKYf1lvR3nIVbaZ3O2uBzwVK+ok=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=UDsCEiLhz4s5QVrIxOkFhi6fKqveZRUg5+2tmwgRTmw9gHLQv9PKf0CXvsJhm5DFTkiS2wTMt+ naST9K/XJKxljnFXA2IjEKaX/9mnCGcftZP+OCisC7dgVV1CrA4lDC4RFmejPquD+wML0J73no scxG3LyqEt3Q455ZuUAPdZE5XKmxN2hOTQy1ENVAkp9HQ2g09pE5rZ0nMlFRBGv0C3eQ6z7AGj cgAUuf3uCfp+1/MeSM1/VlE304JRSuz5jiklnPyeTidL+FF8emwW1Av7of817IVMau8/lXwWMy 7tJgg4wErrcB+vGETxJHtT4XcnFNI0dHLnzGhXyPc9aVIw==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ybaOeEzJdctz/4fD5PVGhfARiLe0/0WpOzbAu/m0wBo=; b=e7V+IgYt8oEjPiFvuSLrW+oxRg EMrzbe4tQmtbztDKPmUtg0bjPLkuy40FgqySy3guVS9e0y0Dk3+vx14ATuzC4T7h5feMFkn7iWPq0 crgEwuy/V4QKg1t6kFxh3yVL9/Qau9UG0mOMxKmjsuOBPajHHV1WJ98aR59jxv9qQLRC16VIDo2Ru NYrNa7vAGnTwZhFyiDNbxeGKtReeJ9nqLw+0P8gMK00KBCd/cu1YDmC2cAmzb1PiRVi5IvCTV5JHM kIGOHOrx1S62PeQtKVI3XxQf2v0Uae2mMa3iJRPYOYd5ldfrt/3GRl3kUmw2F2uzWiSue3X3H7iEO nOeSjuVg==; Received: by zero.zsh.org with local id 1qr0nL-0001eS-QT; Thu, 12 Oct 2023 18:52:27 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f43.google.com) smtp.remote-ip=209.85.208.43; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f43.google.com ([209.85.208.43]:53261) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qr0mf-0000uM-9b; Thu, 12 Oct 2023 18:51:46 +0000 Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-53db1fbee70so2302106a12.2 for ; Thu, 12 Oct 2023 11:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1697136704; x=1697741504; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ybaOeEzJdctz/4fD5PVGhfARiLe0/0WpOzbAu/m0wBo=; b=zRIJLq0mmVObzoG4JMOHEG2VxhhGzRGB6CbEY4hJm/SCMbFb6TZIG5GrC4NfygQEJ8 NMDZSeUMJSa0S3AsRsqTm9odzjlAYplb45gOgVFqFC571qU65HcOMca2ZxX8eaF2IZJD DhPCchxzVEhlPlpe9vZZnhtYGTC6uTRLdExO1msWaqGqpKmII+Y5NgIju4MIBEsNf4NP x1lKeqmifKP7IsPGyF/Tow8lKMlaRxMb3Fxrsj2YJZ63Y7hU06yif8lqu79XskrES2eZ NOhi7mDO1BgxjrIulYJhIbwsFsBRb587oFhvnmWER2SHJhbDA0Q/g9YebSsVvVC5NAZp cGZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697136704; x=1697741504; h=content-transfer-encoding:cc: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=ybaOeEzJdctz/4fD5PVGhfARiLe0/0WpOzbAu/m0wBo=; b=rI3q8XHLYTzDym4cOHYQz8IeCssJuIVnFxiyMY2k4TVl1EfnipEPIK1/PeNoH/q+/u ze7VYeK/INvSFlUcoQ8nmjBK/ybgJUJO1VNcVnP3KF6CAVqlKyYG/qMaArv79jl5Cjxq cx0ENXNqe6vqf8XF/pQOl8ro5AIe9ytd2eO3wwtqi0d4Wz1a3Dgu2fmhsoaMceVWYpxk PMJpWlKMftMlpcMQHYiXIAkTLrJ3+sdX0TkMEmEtG9A+OoydyfP1VQL1hDt/8FkwCSSV OMfsTT5TaLp73npwM5EjGnVeeiuPeD2fWvdJmEwbkEvkZLOhVqoe+K0LLQ0oAbriycs2 fytA== X-Gm-Message-State: AOJu0YyHFTphDGfQI/czFy/M3NRAf03Qvu4X0EpNGaqUoXIBfd/JljhV 0DX2kstLSn0S+GJQTR4eHnNq08AYx4nFsPpdngUP2Q== X-Google-Smtp-Source: AGHT+IFrw5tlbSzamCXv9o36M6knfytIY1RvXdHb3lbTD+XUm03g1NFum14xoiJxRfW6IEHuCfc9DlBN53B9CAn2woY= X-Received: by 2002:a17:906:73d9:b0:9ae:696c:2c47 with SMTP id n25-20020a17090673d900b009ae696c2c47mr20178051ejl.28.1697136703691; Thu, 12 Oct 2023 11:51:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Thu, 12 Oct 2023 11:51:32 -0700 Message-ID: Subject: Re: How to compare for control codes in a string To: henman Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29287 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: On Thu, Oct 12, 2023 at 11:39=E2=80=AFAM henman wrote: > > if [[ $line[1] =3D=3D '\f' ]] # Check if the 1st character is a fo= rmfeed That's checking for the two literal characters backslash and f which will never match a single character as in $line[1]. You probably meant if [[ $line[1] =3D=3D $'\f' ]] # Check if the 1st character is a fo= rmfeed Except with $'...', processing of \f \t \n etc. is not done as part of string interpolation, though you might be fooled into thinking so because it may instead be done by the print and echo commands. > then tmpline=3D${line[@]:1} # strip the ^f off The [@] there doesn't mean anything when $line is not an array, though it's harmless.