LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 05-02-2005, 12:31 PM   #1
gquiring
LQ Newbie
 
Registered: May 2003
Location: Matawan, NJ
Distribution: Red Hat, Solaris
Posts: 20

Rep: Reputation: 0
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?
 
Old 05-02-2005, 02:43 PM   #2
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
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.
 
Old 05-02-2005, 03:25 PM   #3
gquiring
LQ Newbie
 
Registered: May 2003
Location: Matawan, NJ
Distribution: Red Hat, Solaris
Posts: 20

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[c shell] using grep saiz66 Programming 6 09-30-2004 02:45 PM
Shell grep issue philipz Programming 8 05-05-2004 02:50 PM
line addressing with grep (shell scripting) j2dizzo Linux - General 13 03-03-2004 10:36 AM
How to remove or strip control chars in the 'script' utility? fieldmethods Linux - General 1 10-24-2003 02:11 PM
Shell programming - grep?? ducka Programming 15 09-05-2003 05:06 AM


All times are GMT -5. The time now is 09:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration