The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
search from specified charactor space akmix UNIX for Dummies Questions & Answers 6 01-30-2008 07:51 PM
Perl: Search for string on line then search and replace text Crypto Shell Programming and Scripting 4 01-04-2008 06:24 AM
swap space / paging space aaronh AIX 2 05-19-2004 07:06 AM
pageing space vs swap space VeroL UNIX for Dummies Questions & Answers 1 01-22-2004 07:54 AM
Advanced Search Problems.. Search by User Name Neo Post Here to Contact Site Administrators and Moderators 1 05-18-2003 09:28 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-27-2005
Registered User
 

Join Date: Aug 2004
Posts: 141
Search with awk, but having space within

If in my search string with awk, if I have spaces, I am getting an awk error.

e.g. awk /A B/ filename

How can I search the pattern which has space within?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-27-2005
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Just quote the expression

awk "/A B/" filename

or backslash escape the space

awk /A\ B/ filename

Cheers
ZB
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:00 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0