pcregrep, grep based on perl compatible regular expressions

November 20th, 2007 mysurface

grep supposedly support perl regex by specified -P option, but somehow my grep do not support that, it complains this when I trigger with -P grep: The -P option is not supported But when you check the manpage of grep, you will see this -P, –perl-regexp Interpret PATTERN as a Perl regular expression. I found [...]

Posted in pcregrep, printf, Regular Expression, Text Manipulation | Hits: 72669 | 1 Comment »

Print color text in command line.

December 24th, 2006 mysurface

Sometimes echo is not enough, if you need to print more advanced format of text. Lucky, we have printf. printf is a common function call in c programming language, if you learn c before, you should very familiar with this function. Simply illustrate the power of printf, do as follow: printf ‘\n\t\thello\tworld\n’ Besides readable character, [...]

Posted in clear, printf, read, Text Manipulation | Hits: 154623 | 19 Comments »