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

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -