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

[no subject]



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