troubleshooting Question

sed/awk help

Avatar of morsa804tons
morsa804tons asked on
Shell ScriptingUnix OS
5 Comments1 Solution578 ViewsLast Modified:
Hi, i've got a file composed of this kind of stuff:

python3         Solaris  zone  2G-05 colt zfs syslog-ng nemo env-testing-qa1 amadeusapi cachemanager
python4         Solaris  zone  1G-05 colt zfs syslog-ng nemo env-dev-qa1 apache2
python5         Solaris  zone  2G-30 colt zfs syslog-ng nemo env-dev-qa1 jboss
python6         Solaris  zone  2G-05 colt zfs syslog-ng nemo env-dev-qa1 amadeusapi cachemanager
python7         Solaris  zone  1G-05 colt zfs syslog-ng nemo env-testing-qa2 apache2
python8         Solaris  zone  2G-30 colt zfs syslog-ng nemo env-testing-qa2 jboss
python9         Solaris  zone  2G-05 colt zfs syslog-ng nemo env-testing-qa2 amadeusapi cachemanager
bergman1        Solaris  zone 17G-30 colt zfs syslog-ng nemo env-load-qa1 jboss

and i need to keep all words starting with env, but excluding "env-":

testing-qa1
dev-qa1
dev-qa1
...

How i can do that with sed or awk? (preferably sed)

Thanks!
ASKER CERTIFIED SOLUTION
Harisha M G
Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros