|
|
get line number of a searched string - Shell Scripting
|
Views : 131
|
|
Tagged in : Shell Scripting
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
get line number of a searched string
Use "Grep" command to get line number of a searched string.
myVar=` grep -n "Search string" file | cut -f1 -d:`
echo $myVar
   |
|
By Ramya, On - 2011-08-30 |
|
|
|