Unix Technical Forum

How to detect ESCAPE character in a file ?

This is a discussion on How to detect ESCAPE character in a file ? within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hello, i need to detect the ESCAPE character in a file. Currently i use the following command, which works ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-20-2008, 01:39 PM
Patrick Tonnerre
 
Posts: n/a
Default How to detect ESCAPE character in a file ?

Hello,

i need to detect the ESCAPE character in a file.
Currently i use the following command, which works :
cat -vte myfile | grep "\^\["

Is it a good solution and is there other better ways to detect it ?

Thanks in advance
--
Patrick
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-20-2008, 01:39 PM
sjm
 
Posts: n/a
Default Re: How to detect ESCAPE character in a file ?

On 18 Mar, 15:11, Patrick Tonnerre <nos...@nospam.org> wrote:
> Hello,
>
> i need to detect the ESCAPE character in a file.
> Currently i use the following command, which works :
> cat -vte myfile | grep "\^\["
>
> Is it a good solution and is there other better ways to detect it ?


If it works, it is a good solution. If however, the character sequence
^[ is legitimate in your "myfile" (before processing with cat -vte),
then this does not work as you would want and is it not a good
solution.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-20-2008, 01:39 PM
Gerard H. Pille
 
Posts: n/a
Default Re: How to detect ESCAPE character in a file ?

On Mar 18, 4:11 pm, Patrick Tonnerre <nos...@nospam.org> wrote:
> Hello,
>
> i need to detect the ESCAPE character in a file.
> Currently i use the following command, which works :
> cat -vte myfile | grep "\^\["
>
> Is it a good solution and is there other better ways to detect it ?
>
> Thanks in advance
> --
> Patrick


If "^[" is a possible sequence, then

od -c myfile | grep ' 033'

would do a better job
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:08 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com