|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Print pattern regardless of space between
I have this content in file Code:
sshd : ALL : allow SSHD : all : ALLOW sshD : All : AllOW What I need is to print the occurrence of "sshd:all" regardless of the spaces between them and if lower/upper case. So all lines should be printed in output when "grepped" or "printed using awk/sed" |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thanks worked perfectly
|
|
#4
|
||||
|
||||
|
Code:
grep -i '^[ \t]*sshd[ \t]*:[ \t]*all[ \t]*:' file |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need one liner to search pattern and print everything expect 6 lines from where pattern match made | chidori | Shell Programming and Scripting | 8 | 03-15-2012 11:46 AM |
| Print characters till the next space when the pattern is found | gpk_newbie | Shell Programming and Scripting | 2 | 10-19-2011 05:02 AM |
| Print a pattern between the xml tags based on a search pattern | oky | Shell Programming and Scripting | 13 | 03-21-2011 01:03 PM |
| Find a pattern and print next all character to next space | pierrebjarnfelt | Shell Programming and Scripting | 8 | 05-18-2010 06:11 AM |
| Use to awk to match pattern, and print the pattern | grossgermany | Shell Programming and Scripting | 6 | 09-23-2009 01:49 PM |
|
|