The DNS Guys |
Anycast DNS 25 Nameservers Worldwide |
DNS Failover Host Monitoring & Auto Rollback |
Outbound SMTP Smart Relay, SASL |
| Subversion Hosting OpenID Servers & XMPP |
DNSSEC TSIG & Secondary DNS |
easyRoute53 Amazon Route53 GUI |
![]() ![]() |
Sep 25 2012, 06:50 AM
Post
#1
|
|
|
Whats this Lie-nix Thing? ![]() Group: Members Posts: 1 Joined: 25-September 12 Member No.: 17,857 |
Hi!
I've been trying to figure out a few things with grep but I'm really stuck now. 1. I'm trying to grep anything that starts with an "a", but doesn't have any more "a":s. Which means that grep would show me words like "and", but not words like "america". 2. I'm trying to grep anything that doesn't contain "a" at all. I know it's easily done by using "grep -v a". However, I'm trying to do this without using "-v". I've tried things like "grep [^a]", but that would only remove things that contain "a" only. I've tried using * and .* but it doesn't help me at all. Help is very appreciated! |
|
|
|
Nov 21 2012, 02:39 PM
Post
#2
|
|
|
Whats this Lie-nix Thing? ![]() Group: Members Posts: 6 Joined: 21-November 12 Member No.: 17,973 |
Number 1 would best be accomplished by piping one grep to another:
grep ^[aA] ./filename | grep -v [aA].*[aA] Number 2 would best be accomplished by using the -v option. Why are you trying to avoid using "grep -v [aA]" |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 19th May 2013 - 04:13 AM |