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

complete the script(unix perl Write a perl script named search.pl that accepts

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!