Question
Perl Programming... Write a program that changes to some particular (hardcoded) directory, like the systems root directory, then executes the ls -l command to get
Perl Programming...
Write a program that changes to some particular (hardcoded) directory, like the systems root directory, then executes the ls -l command to get a long-format directory listing in that directory. (If you use a non-Unix system, use your own systems command to get a detailed directory listing.
Modify the previous program to send the output of the command to a file called ls.out in the current directory. The error output should go to a file called ls.err. (You dont need to do anything special about the fact that either of these files may end up being empty.
Write a program to parse the output of the date command to determine the current day of the week. If the day of the week is a weekday, print get to work; otherwise, print go play. The output of the date command begins with Mon on a Monday. If you dont have a date command on your non-Unix system, make a fake little program that simply prints a string like date might print. Well even give you this two-line program if you promise not to ask us how it works:#!/usr/bin/perlprint localtime( ) . " ";
(Unix only) Write an infinite loop program that catches signals and reports which signal it caught and how many times it has seen that signal before. Exit if you catch the INT signal. If you can use the command-line kill, you can send signals like so:$ kill -USR1 12345If you cant use the command-line kill, write another program to send signals to it. You might be able to get away with a Perl one-liner:$ perl -e 'kill HUP = 12345'>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started