Grep not working for string with both spaces and numbers
by wackysiy1024 from LinuxQuestions.org on (#57QSE)
Hi
I am trying to print all the following entries from my input file.
Quote:
Since my string had a space,I wrote the grep in following format Quote:
I wanted to get all the paths printed(in this case path 0-path 3)It didnt work. I also tried for another example string where i am trying to print the required strings with all paths and different cores. (essentially I am trying to print all with all different datapath and all values of icore
Expected output:
Quote:
Any awk or sed commands to do this?


I am trying to print all the following entries from my input file.
Quote:
pptstatistics#rtpRequestCount#path 0#rate pptstatistics#rtpRequestCount#path 1#rate pptstatistics#rtpRequestCount#path 3#rate pptstatistics#rtpRequestCount#path 2#rate |
grep "pptstatistics#rtpRequestCount#path *#rate " inputfile > output file |
Expected output:
Quote:
datapath icore all parameter ocr-frames#datapath:0#icore:2 datapath icore all parameter ocr-frames#datapath:3#icore:5 datapath icore all parameter ocr-frames#datapath:5#icore:2 grep "datapath icore all parameter ocr-frames#datapath:*#icore:*" inputfile > output file |