LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   grep searching for control chars shell issues (https://www.linuxquestions.org/questions/linux-general-1/grep-searching-for-control-chars-shell-issues-319367/)

gquiring 05-02-2005 11:31 AM

grep searching for control chars shell issues
 
I am having a hard time getting grep to search for control characters because of the shell. I cannot get grep '\023' filename to work on any shell. grep '\x16' also does not work. Does anyone know how to quote this to work in ksh?

Technoslave 05-02-2005 01:43 PM

Don't quite know what those are special characters are. Generally speaking, the only time I've run in to special characters are when I grab a txt document from a PC, when I open it there are a bunch of ^M at the end of the lines. To get rid of those this is what I'd do ( assume that ^ means hit control )

:%s/^V^M//

So I hit control V then control M and that creates what I need.

gquiring 05-02-2005 02:25 PM

I cannot type some of the chars I need to search for, some are over dec 128. For some reason the shell is interfering with the backslash with Linux or Solaris when using ksh or sh.


All times are GMT -5. The time now is 08:23 PM.