Is there a way to grep
every other line of a line? For example, just grep
the odd or even lines only of a file.
I read the man page for grep
and I don't see such option. I also want to get the line after the match
grep -A1 (some option here to only look at odd lines) "pattern" filename
The command I am using in my perl script:
@rows = `LANG=en_US.UTF-8 grep --include="image_args_search_*.txt" --exclude-dir=".misc" --exclude-dir=".image_args" --exclude-dir=".image_args_clean" --exclude-dir=".image_args_text" --exclude-dir=".image_args_\
init" --exclude-dir=".misc" --exclude-dir="buscar" --exclude-dir=".config" --exclude-dir="*_bak*" --exclude-dir="indexacao_de_*" --exclude-dir="*.cgi" --exclude-dir="*.pl" --exclude-dir="imagens" --exclude-dir="loaded\
_dispenses" --exclude-dir="1o_tabeliao_de_notas_de_jundiai" --exclude-dir="*_orig" --exclude-dir="checar" --exclude-dir="indexar" --no-group-separator -A1 -iHIER "$operator" $include_dirs`;
Thanks!