简体   繁体   中英

Grep special character #‘

trying to grep "#'om" but not able to escape or account for the quote char. I tried grep -F , grep -e , grep -n or simply grep "#\'om" to no avail.

That quote is not the simple quote character it appears to be. It's not clear whether copying-and-pasting the quote character from this website is accurate.

$ echo '‘' | cat -v
M-bM-^@M-^X

$ echo '‘' | xxd
$ 00000000: e280 980a                                ....

So, it appears the problem is one of character sets.

Note, however, that the following works for me:

$ echo '‘' | grep -F '‘'
‘

As does the following:

$ echo '#‘om' | grep -F '#‘om'
#‘om

It would help to see exactly what is being tried. Perhaps use xxd to confirm what bytes are making up that quote.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM