开放

Perl program

Title: pkginfo with Perl

you will write a Perl program which simulates the behaviour of command pkginfo (a command available in some versions of Unix). Your Perl program will parse a file containing information about installed software packages and will generate output depending on the command line.

These are the specifications for your Perl program:

It must be named [url removed, login to view]

It must be invoked as:

[url removed, login to view] option installed_software_file

The program must check that the installed_software_file argument exists, is a file and is readable. If not, it must print an error message to the standard output and exit. The values for the option argument are described below.

File installed_software_file can have any arbitrary name. It must be a file of text with the following format:

The file consists of an arbitrary number of lines (including, possibly, zero lines).

Each line must contain four fields separated by commas.

The four fields are: category, name, description, size in kilobytes.

The category and name fields are each a string of characters of arbitrary (yet reasonably limited) length. Acceptable characters include: lower and upper case letters, digits, underscore, dot.

The description field is a string of characters of arbitrary (yet reasonably limited) length. Acceptable characters include: lower and upper case letters, digits, underscore, dot, ‘+’, ‘/’, ‘-‘, space.

The size in kilobytes field is an integer limited between 1 and 10000000.

The following is an example of file installed_software_file:

system,SUNWdoc,Documentation Tools,1251 application,SPROcpl,C++ Compiler,25477 system,BRCMbnxe,Broadcom NIC Driver,5423 newcat,madeup,a made up line,100000 application,ecj,Eclipse JDT,75443

Very important note: your program is not expected to verify that file installed_software_file complies with the above specifications. It will only be tested with compliant files.

Your program can be invoked with option: -a. In this case, it must print the following:

Installed software:

<first name in appearance order>

<second name in appearance order>

<last name in appearance order>

Example with the example installed_software_file given above:

Command line:

[url removed, login to view] -a installed_software_file Installed software:

SUNWdoc

SPROcpl BRCMbnxe madeup ecj

In the case in which file installed_software_file is empty, your program must instead only print:

No software installed

Your program can be invoked with option: -s. In this case, it must only print the following string:

Total size in kilobytes: <total size in kilobites of all the installed packages>

Example with the example installed_software_file given above:

Command line: [url removed, login to view] –s installed_software_file

Output:

Total size in kilobytes: 207594

In the case in which file installed_software_file is empty, your program must print:

Total size in kilobytes: 0

Your program can be invoked with option: -l <name>. Argument <name> follows the same rules as the name field. In this case, it must print:

Package <name>:

Category: <category>

Description: <description>

Size in kilobytes: < size in kilobytes>

Example with the example installed_software_file given above:

Command line:

[url removed, login to view] –l ecj installed_software_file

Output:

Package ecj:

Category: application

Description: Eclipse JDT Size in kilobytes: 75443

In the case in which name <name> is not present in installed_software_file, your program must print:

No installed package with this name

Your program can be invoked with option: -v. In this case, it must only print your name, surname and student ID in a format of your choice.

No options can be used simultaneously. This means that your program can only be invoked with one of the options at a time.

If your program is invoked with a valid file argument, but any other syntax than what specified above, it must only print the following string to the standard output:

Invalid command syntax

Example:

Command line: [url removed, login to view] -Z installed_software_file

Output:

Invalid command syntax

Zip your file [url removed, login to view] into a file named USP_<yourSurname>_<yourStudentID>.zip and submit it with the modalities specified above. Several free zip utilities are available on the

WWW.

技能: PHP, 软件构架

查看更多: perl program recursively unzip files work, perl program renaming files, perl program serial port communication usb, design program keeps running total number seven days, perl program read data website, write perl program give result user needed, perl program contracts conversions, perl program crypt linux, perl program remove html tag, perl html title, perl program snapshot web page, perl program download utube movies, perl program bid, simple perl program, perl program find match characters contains

About the Employer:
( 0 reviews ) Australia

项目ID: #15395485

已悬赏给:

nmsandroid

We will make a script with well documentation comments Also we will share the user documentation for same

$40 AUD 在2天内
(14条评论)
3.5

3名威客为此工作的平均竞标价是$32

gsap54

This project is where my interest and work coincide.

$30 AUD 在5天内
(0条评论)
0.0
vrandaupadhyay

Hello Sir/mam, AS per your requirement I have all skills required for you project. I am able to give you project on time in appropriate rate. Looking for you. Thanks!!! Stay tuned, I'm still working on this proposal.

$25AUD 在1天里
(0条评论)
0.0