Skip to content
Advertisement

Looping through the file,searching nan’s

I have file with 12000 lines,some of them are nan’s I have written bash,to search for these nan’s

JavaScript

But only this appears on the screen

JavaScript

What’s wrong with my bash?

Advertisement

Answer

you are using exit statement, that means this script will immediately exit after printing FIRST error: Not a number . So what is the problem with the script?

People may do if grep '^[0-9]+([.][0-9]+)?$' file0.txt then instead.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement