Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re:



Il giorno gio 12 ott 2023 alle 20:40 henman <dhenman@xxxxxxxxx> ha scritto:
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

hello, this should work:

if [[ $line[1] == $'\f' ]]

cheers


Messages sorted by: Reverse Date, Date, Thread, Author