0

I have file like this :

abc cde 3
abc def 2
abc rig 1
def rer 0
def ada 5
gia  dada 6
gia da 7
gia lla 9

and I want to read the file and looping only when the first column contain abc , the output is like this :

abc cde 3
abc def 2
abc rig 1

how can I do it in linux bash script?

i try to use while read but cannot done with condition

Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223
necronom
  • 11
  • 1
  • 2
    You have to search by yourself, then try something. If you were stuck, ask. Please, read [How to create a Minimal, Complete, and Verifiable Example.](https://stackoverflow.com/help/mcve) – Gilles Quénot May 04 '23 at 03:13
  • Better use `awk` here. It's a very simple task for it. There's tons of examples here. – Gilles Quénot May 04 '23 at 03:14

0 Answers0