Question: complete the script(unix perl Write a perl script named search.pl that accepts one command line argument (string of characters) and prints all the line numbers
complete the script(unix perl

Write a perl script named search.pl that accepts one command line argument (string of characters) and prints all the line numbers and the lines in th testfile that contain the given string. For example: /search why Prints all the lines and the line numbers in the testfile which contain string why Example: $ more testfile hello How are you abcd beautiful day $./search.pl beauti 3 abcd beautiful day Complete the script: #1/usr/bin/perl $file = "testfile", open (FNAME, Scheck- while ($line = or die("Couldn't open Sfile for reading"); ) t Si++; if ( print " close(FNAME)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
