Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[no subject]
- X-seq: zsh-users 29286
- From: henman <dhenman@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject:
- Date: Thu, 12 Oct 2023 11:39:26 -0700
- Archived-at: <https://zsh.org/users/29286>
- List-id: <zsh-users.zsh.org>
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.
---------
Messages sorted by:
Reverse Date,
Date,
Thread,
Author