UNIX/Linux shell script(some grep|sed|awk tricks)