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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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. |
| ||||
| 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 |