You are not logged in.
looked around the internet but not really found a working solution (or my exact question), so figured i'd ask here.
i have this example:
Options specific to device `epson2':
Scan Mode:
--mode Lineart|Gray|Color [Lineart]
Selects the scan mode (e.g., lineart, monochrome, or color).
--depth 8 [inactive]
Number of bits per sample, typical values are 1 for "line-art" and 8
for multibit scans.
--dropout None|Red|Green|Blue [None]
Selects the dropout.
--brightness 0..0 [inactive]
Selects the brightness.
--sharpness -2..2 [inactive]what i want is to remove the entries with 'inactive' (because i don't need them!)
when i use 'grep -v "inactive"' it will return just the lines without 'inactive'. but, as you can see, these are multiple-line entries. obviously i do not want the description coming with the inactive lines either. but, the description is sometimes a single line and sometimes more.
i figure what i want is a way to evaluate each '--', see if it has 'inactive', drop it if it has and skip over to the next occurrence of '--'. but i have no idea how to go about that.
so, how do i do this?
Offline
maybe
grep -e -- file | grep -v inactiveOffline
maybe
grep -e -- file | grep -v inactive
thanks! modified slightly, this one works like a charm!
grep -e "--*" temp.txt | grep -v "inactive"i remember trying before to pipe grep into grep, and it did not work and i read somewhere it could but forgot how so discarded this option already! thanks again man!
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.