shell - using grep in if statment in unix -


I am a newbie in UNIX, I am trying to write a script that grep and line and file on a certain word It will be printed where it was found that if it is not available and is not available, then it is not available

This is my code

  #! Set the / bin / csh foreach file (`cat file1 ') a =` echo $ file | Grep -n "ok" `if (" $ a "-ne 0) then" $ a "| Encoding $ file second echo "not found" and end and    

correct syntax

  #! / Bin / csh foreach file (`cat file 1`) set a =` echo $ file | Grep -n "ok" `if (" $ a "! =" ") Then" $ a "echo $ file else resonant" Android and "   

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -