Project #24052 - unix shell and perl

I need guidance for the following scripts.  If there is a need to create a superuser to perform these scripts, I will need those instructions also.

Script 1

A Unix shell script for automating the shutdown process. Write a script that will perform the following tasks:

1.      Prompt the system administrator for all valid input parameters.

2.      Ask if a wall needs to be sent, and if yes, send the message.

3.      Ask if this is a shutdown or reboot, and process appropriately.

 

Script 2

A Unix Shell script for user maintenance. Write a script that will perform the following tasks:

1.      Prompt the system administrator for all valid input parameters

2.      Generate a menu to ask which task is needed to be performed

3.      Create a UNIX group

4.      Drop a UNIX group

5.      Create a user

6.      Drop a user

Special Note: As part of the Create User section, a UNIX group may be identified that does not already exist, so that group will need to be created as part of the process.

 

Script 3

A Perl script to kill all of the processes associated with a user. The following are the requirements:

1.      Prompt the system administrator for the target user name

2.      List the running processes for that user

3.      Confirm with the system administrator before killing the processes

4.      Kill the processes after confirmation

Special Note the script should only kill processes for a user and his or her running processes; do not arbitrarily kill running daemons.


 

Script 4

A Perl script that does the following:

1.      Prompts for your name

2.      Checks if the entered name is the same as your instructor's name

3.      If yes, it prints: “Hi Instructor”

4.      Otherwise, it prints: “, you must be a student”

 

Special note: Instructor’s name “John Madden”

 

Script 5

Write a Perl program that performs the following tasks:

Generate a menu to ask the user for the task that he or she would like to see performed.

1.      The available tasks are as follows:

Ø  Show current date and time.

Ø  Show users currently logged in.

Ø  Show the name of the working directory.

Ø  Show the contents of the working directory.

2.      Prompt the user for the choice, and perform the system command.

 

Script 6

Convert (Script 2) into a Perl script. The Perl script must perform the following tasks:

1.      Generate a menu to ask the system administrator for the task that he or she would like to see performed.

2.      The available tasks are as follows:

Ø  Create a UNIX group.

Ø  Drop a UNIX group.

Ø  Create a user.

Ø  Drop a user.

3.      Prompt the user for the choice, and perform the system command.

Special Note: Verify that before creating either the user or the group that neither already exists; if it does already exist, print out the existing user ID, comment field, and home directory locations from the password file.

Script 7

Add Script 3 the ability to kill a user’s processes, it must include the following:

1.      Add this option to the menu.

2.      Add the code/process into a subroutine.

3.      Use an array to store the list of processes that need to be reviewed and killed.

4.      Process the kill using the array.

Script 8

Finally, take the following C program (save it as "power2.c"), and create it as a file in the UNIX environment:

/* power2.c -- Print out powers of 2: 1, 2, 4, 8, .. up to 2^N */

 

#include

#define N 16

 

int main(void) {

int n; /* The current exponent */

int val = 1; /* The current power of 2 */

printf("\t n \t 2^n\n");

printf("\t================\n");

for (n=0; n<=N; n++) {

printf("\t%3d \t %6d\n", n, val);

val = 2*val;

}

return 0;

}

/* It prints out :

n 2^n

===============

0 1

1 2

2 4

3 8

4 16

5 32

6 64

7 128

8 256

9 512

10 1024

11 2048

12 4096

13 8196

14 16384

15 32768

16 65536

*/

 

 

Lastly, describe the behavior when you compile the program, with no options. What is the command that you would use to compile the code and create the executable "power2"?

Subject Computer
Due By (Pacific Time) 03/03/2014 12:00 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy