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
Need help with my assignment

Problem 1 Define the architecture of UNIX operating system with appropriate diagram Problem 2 Define the term inter-process communication. What are several approaches t

I''m studying electrical engineering, and this semester im taking course that called Computer Design. in this course they need me to a final project about any thing we took during

A large logistics company requires a software system to support the business processes associated with managing shift patterns of employees and making the associated payments. The

We are need of a PrestaShop Expert We are getting a fresh design created for our Jewellery website. This job is in 2 parts 1. The website engine is PrestaShop as well as w

You are asked to develop a replicator (client) that distributes a large job over a number of computers (a server group) on a single switched LAN (our BU04 lab). In this assignment,

QUESTION 1 (a) (i) What is linear programming problem? (ii) Define and explain the following terms: (1) objective function, (2) decision variable, (3) constraints, (4) feasi

What will be the output for the following instruction if CX=9087H and AX=9090H? 1) BTR AH,2? 10010000=10010000 2) BTC CX,9?1001000010000111=1001000110000111 3) NEG AX?

(a) (i) What do you meant  by a function? Are functions required when writing a C program? (ii) State one of the advantages to the use of functions. (iii) What do you meant by a

Dynamic Binding: - Binding refers to the linking of a procedure call to the code to be executed in response to the call. Dynamic binding (late binding) means that the code associa