1

I am running a script that fetches me the data as given below,

1400d2b8
1f4d1e2507
1200781e

As you can see the 3rd and 4th character is 0 in line 1 and line 3. I am trying to write a single line script that prints the line except the lines containing 00. In this case it should only print 1f4d1e2507.

2 Answers 2

2

There are lots of ways, e.g.,

awk '/^..00/{ next; }{ print; }' < mydata
sed '/^..00/d' < mydata
0
2

grep can do that:

grep -v '^..00' inputfile
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.