Write a perl script that prints the contents of a file, Programming Languages

Assignment Help:

Write a Perl script that prints the contents of a file

  • Write a Perl script that prints the contents of a file, prefixing each line with a line number. The script should accept exactly one argument representing the name of the file.
  • The script should be able to handle the following error conditions:

 

  1. Incorrect number of arguments
  2. The specified argument is not a file.
  • You cannot use the UNIX "cat" command in this assignment. You must use Perl to read the file and count the lines.
  • You cannot use the UNIX "nl" command in this assignment.
  • The printf function in Perl is useful for formatting numbers.
  • The script must be able to execute on Einstein
  • The script file name must be: linenum
  • The script must be located in $HOME/itec400/homework
  • Make sure the permissions on the your itec400 directory are 705
  • Make sure the permissions on your script are 705.

Related Discussions:- Write a perl script that prints the contents of a file

How will you add styles to a document, Question 1 How will you add styles ...

Question 1 How will you add styles to a document? Question2 How will you view XML in different ways? Question 3 Explain various file handling mechanism available in PERL

Nature of the empirical data in pascal programming, You will soon receive i...

You will soon receive in an email a personalized assignment that tells you the nature of the "Empirical Data" you are to produce with a Pascal program for HW3. HW3 is about generat

Visual logic, how much it will cost? i need learn how to make rightsided tr...

how much it will cost? i need learn how to make rightsided triangle in forloop

String data transfer instruction in assembly language, What are the string ...

What are the string data transfer instruction in assembly language? Explain all types of string data transfer instructions with examples of each? What will be the behavior of direc

Use an insertion sort to sort an array, Use an insertion sort to sort an ar...

Use an insertion sort to sort an array (sequence) of long word integers. The size of the list will appear just before the list itself. Use the same labels as in this example: LE

Prolog predicate for list that contains duplicate elements, Write a Prolog ...

Write a Prolog predicate  has_duplicates(L)  that is true if list  L  contains duplicated elements (that is at least 2 copies of an element). For instance: ?- has_duplicates([a,

Return value in an array, A specification of a function TOARR is given belo...

A specification of a function TOARR is given below. function TOARR(n in Int, s in Stack of Int) return in Array of Int pre n ≥ 0. post The returned value is an array of size

Access modifiers, Access Modifiers Convenience Modifiers or we can say (Acc...

Access Modifiers Convenience Modifiers or we can say (Access Specifies) identifies as the opportunity of accessibility of an Item and its associates. All C# kinds and kind associat

To print total no.of ordinary files, Normal 0 false false f...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Triple eigenvalue with 2 linearly independent eigenvectors, 1 Triple Eigenv...

1 Triple Eigenvalue with 2 Linearly Independent Eigenvectors       In this case we will have the eigen-value l with the two linearly independent eigenvectors  ?h 1 and  ?h 2

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd