The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-24-2007
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,767
Most versions of awk allow you to represent non-printing characters as hex values.
\x01B is ASCII 27, the escape character.

Code:
awk '{ if (index($0, "\x01B") ) { print $0 }}' myfile
will find the escape character anywhere on a line in a file, like grep. You will need to construct a whole string of hex chars to find the exact sequence you want.