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

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.
Posted Date: 2/18/2013 5:46:31 AM | Location : United States







Related Discussions:- Write a perl script that prints the contents of a file, Assignment Help, Ask Question on Write a perl script that prints the contents of a file, Get Answer, Expert's Help, Write a perl script that prints the contents of a file Discussions

Write discussion on Write a perl script that prints the contents of a file
Your posts are moderated
Related Questions
Question 1: a) Assume that B is an array of 50 words; write a code which will place the smallest integer of array B in register AX. b) Write a small code (only three instr

Triple Eigenvalue with 1 Eigenvector The eigenvalue/vector pair in this case are l and  ?h , . Since the eigenvalue is real we know as the first solution we require is, e l

Expertsmind brings you unique solution in java assignments Reflection API Uses of Reflection with java assignment help Reflection is widely used by applications which

A traveler wants to purchase a number of traveler''s checks, each having a set amount for four different currencies: Mexican pesos, Euro dollars, Swiss francs, and US dollars. A t

Assume that you are a college professor needing to average grades for 10 students. Write a program that asks for each student's name and grade. Print the list on-screen with each s

Calculate the total price based on several key parts required to build a state-of-the-art gaming computer. The user will have the option of selecting different parts.

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

specify the function of the instruction and also specify whether its right or wrong-: (5) 1) MOV [BX],AX? Register Indirect addressing 2) MOV CX,[BX+DI]?Base plus index add

Prepare an XML document that contains calendar information such as the following text describes: The calendar is owned by a person (e.g. John Smith) and has a few paragraphs tha

A manager at the local Walmart needs to determine how many workers to hire to cover a 24-hour period. Each worker must work 9 consecutive hours but may only start work at the begin