Computing.Net > Forums > Linux > Grepping beginning of line...

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Grepping beginning of line...

Reply to Message Icon

Name: daelomin
Date: August 7, 2006 at 09:03:35 Pacific
OS: Mandriva
CPU/Ram: P4 1gig
Product: Dell
Comment:

hi,

I cannot seem to grep the beginning of line character when combining it with say a space in a regular expression.

Namely, I want to grep all occurences of CALL in a file but only when it is preceded by spaces or the beginning of line character.

I tried doing this:

grep "[ ^]CALL" file

but it does not work.
I cannot put the ^ before for it inverses the selection...

Any idea?

Thanks




Sponsored Link
Ads by Google

Response Number 1
Name: lchi2000g
Date: August 7, 2006 at 09:12:06 Pacific
Reply:

Use:

grep "^[ ]*CALL" file

Luke Chi


0

Response Number 2
Name: daelomin
Date: August 7, 2006 at 09:54:43 Pacific
Reply:

Thanks man!

:)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Grepping beginning of line...

store result of grep -e to variable www.computing.net/answers/linux/store-result-of-grep-e-to-variable/15837.html

Grep problem www.computing.net/answers/linux/grep-problem/27258.html

Contextual Grep in Unix? www.computing.net/answers/linux/contextual-grep-in-unix/24812.html