Hello, everybody. I have read some examples and manuals for the egrep command for Linux and I don't know if this egrep command is right for the particular files I am searching for. Here is what the question says:
Read documentation about the Unix egrep command. Then,
write an egrep command that will search all files, in the current
directory or any subdirectory (or sub-subdirectory, etc), such that
the file name has a 7 or 8 in the name; and within each such file,
print any line satisfying the following criterion: in the line there is
a word (consisting of entirely alphabetic characters, with no spaces,
quotes, hyphens or digits) that has the following three things, in
this order: (i ) some lower-case letter in the range d through k; (ii )
the letter e or the letter j; and (iii ) the word ends with ion – some
examples are Evangelion, Dandelion, parhelion, triskelion.
I came up with this egrep command:
egrep '([:alpha:].[ion$])|(-v [:punc:][:space:])' "7|8" *.txt
Please tell me if this egrep command is correct or give me suggestions on how to improve it. Thank you.
Read documentation about the Unix egrep command. Then,
write an egrep command that will search all files, in the current
directory or any subdirectory (or sub-subdirectory, etc), such that
the file name has a 7 or 8 in the name; and within each such file,
print any line satisfying the following criterion: in the line there is
a word (consisting of entirely alphabetic characters, with no spaces,
quotes, hyphens or digits) that has the following three things, in
this order: (i ) some lower-case letter in the range d through k; (ii )
the letter e or the letter j; and (iii ) the word ends with ion – some
examples are Evangelion, Dandelion, parhelion, triskelion.
I came up with this egrep command:
egrep '([:alpha:].[ion$])|(-v [:punc:][:space:])' "7|8" *.txt
Please tell me if this egrep command is correct or give me suggestions on how to improve it. Thank you.
Comment