minil |
12-29-2005 06:29 AM |
Need Grep command for the following output
Hi
i need grep command for the following output.
I have a file. as given below
Code:
#192.168.48.155
10.0.0.4
#11.0.0.1
#239.0.01
#12.1.0.1
192.168.48.172
192.168.48.100
#192.158.32.0
Questions as follows - To print lines which starts with # character.(# as first character .No space shoule be there #character). Output should be(Idont want blank lines.
Code:
#192.168.48.155
#239.0.01
#192.158.32.0
- To print lines which with # character as first character in line and also line with any number of space followed by #character. output should be.
Code:
#192.168.48.155
#11.0.0.1
#239.0.01
#12.1.0.1
#192.158.32.0
- To print lines which starts only with space character followed by # as first . Output should be as follows
Code:
#11.0.0.1
#12.1.0.1
- To print lines which contains space followed by any characters
Code:
#11.0.0.1
192.168.48.172
#12.1.0.1
Its urgent..
Thanks in advance.
|