Search code examples
shellsolaris-10

How to do a grep on expression "\e"


I'm on SOLARIS10. The grep of this operating system doesn't accept the "-e " option. I would like to do a grep on the line beginning by \e in my log file.

I did

grep  "\\e" file.log

Doesn't work I 've got all the line of the files, and

grep  "/\e" file.log

stops on the first line that the tool met.

Thanks for you help


Solution

  • Try the below grep,

    grep '^\\e' filename

    Or

    Try the below sed,

    sed -n '/^\\e/p' filename