The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #1 (permalink)  
Old 06-23-2008
ripat ripat is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2006
Location: Belgium
Posts: 438
grep non printable characters

Sometimes obvious things... are not so obvious. I always thought that it was possible to grep non printable characters but not with my GNU grep (5.2.1) version.

Code:
printf "Hello\tWorld" | grep -l '\t'
printf "Hello\tWorld" | grep -l '\x09'
printf "Hello\tWorld" | grep -l '\x{09}'
None of them work. I know that work-arounds with od, cat -vet or sed are possible but why not simply with grep that is meant to do this type of job?

What am I doing wrong?