zsh-users
 help / color / mirror / code / Atom feed
From: henman <dhenman@gmail.com>
To: zsh-users@zsh.org
Subject: 
Date: Thu, 12 Oct 2023 11:39:26 -0700	[thread overview]
Message-ID: <CAC2FHtSqa02G85+ty_d2x+M3EufNbsXjrsg1TkeU3ia9zf9U3g@mail.gmail.com> (raw)

Subject: How to compare for control codes in a string
X-Mailer: MH-E 8.6+git; GNU Mailutils 3.16; Emacs 29.1
--------


I want to see if the 1st character in a string is a formfeed and then remove it.

I use the following script to check it

    if [[ $line[1] == '\f' ]]    # Check if the 1st character is a formfeed
        then tmpline=${line[@]:1}  # strip the ^f off
        fi

but it's not working.  How should it be checked?


Thank you.
---------


             reply	other threads:[~2023-10-12 18:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12 18:39 henman [this message]
2023-10-12 18:51 ` How to compare for control codes in a string Bart Schaefer
2023-10-12 22:22 ` Pier Paolo Grassi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAC2FHtSqa02G85+ty_d2x+M3EufNbsXjrsg1TkeU3ia9zf9U3g@mail.gmail.com \
    --to=dhenman@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).