zsh-users
 help / color / mirror / code / Atom feed
* (no subject)
@ 2023-10-12 18:39 henman
  2023-10-12 18:51 ` How to compare for control codes in a string Bart Schaefer
  2023-10-12 22:22 ` Pier Paolo Grassi
  0 siblings, 2 replies; 3+ messages in thread
From: henman @ 2023-10-12 18:39 UTC (permalink / raw)
  To: zsh-users

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.
---------


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-12 22:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-12 18:39 henman
2023-10-12 18:51 ` How to compare for control codes in a string Bart Schaefer
2023-10-12 22:22 ` Pier Paolo Grassi

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).