UNIX Scripting using Gnome

Week 2 IP

 

Weekly tasks or assignments (Individual or Group Projects) will be due by Monday and late submissions will be assigned a late penalty in accordance with the late penalty policy found in the syllabus. NOTE: All submission posting times are based on midnight Central Time.

You now need to write a script for user maintenance. Write a script that will perform the following tasks:

  • Prompt the system administrator for all valid input parameters
  • Generate a menu to ask which task is needed to be performed
  • Create a UNIX group
  • Drop a UNIX group
  • Create a user
  • Drop a user

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

A third script that you need to write will kill all of the processes associated with a user. The following are the requirements:

  • Prompt the system administrator for the target user name
  • List the running processes for that user
  • Confirm with the system administrator before killing the processes
  • Kill the processes after confirmation

It is very important to note with this task that you should only kill processes for a user and his or her running processes; do not arbitrarily kill running daemons.

  • Include a discussion about the difference between user processes and daemons.
    • What are daemons, and what are they used for?
    • What are the consequences of killing a daemon using this script?
  • Add the 2 scripts and the discussion about daemons to the project template section “UNIX Processes.”

 

Week 3 IP

Weekly tasks or assignments (Individual or Group Projects) will be due by Monday and late submissions will be assigned a late penalty in accordance with the late penalty policy found in the syllabus. NOTE: All submission posting times are based on midnight Central Time.

To become familiar with Perl programs and to see how to interact with the operating system, 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.
  • 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.
  • Prompt the user for the choice, and perform the system command.

Also, describe how variables in Perl are handled, specifically with respect to the need for declaration and type casting.

  • Add the script and the discussion about variables to the project template section “Introduction to Perl.”

 

week 4 IP

 

Weekly tasks or assignments (Individual or Group Projects) will be due by Monday and late submissions will be assigned a late penalty in accordance with the late penalty policy found in the syllabus. NOTE: All submission posting times are based on midnight Central Time.

Convert your second shell script (User Maintenance) into a Perl script. This Perl script must perform the following tasks:

  • Generate a menu to ask the system administrator for the task that he or she would like to see performed.
  • The available tasks are as follows:
    • Create a UNIX group.
    • Drop a UNIX group.
    • Create a user.
    • Drop a user.
  • Prompt the user for the choice, and perform the system command.
  • In addition, check to make sure 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.

Include a discussion about what regular expressions are and how Perl efficiently includes regular expression processing in the language. Be sure to state examples.

  • Add the Perl code and the discussion about Regular Expressions to the project template section “Writing Perl Programs.”

 

 

week 5 IP

 

Weekly tasks or assignments (Individual or Group Projects) will be due by Monday and late submissions will be assigned a late penalty in accordance with the late penalty policy found in the syllabus. NOTE: All submission posting times are based on midnight Central Time.

You have completed the code for the automation of the required tasks; the final step is to submit the script to the team for use. After you have incorporated any appropriate feedback into your project, one last requirement needs to be addressed.

Add to your Perl script the ability to kill a user’s processes (from shell script 3). The requirements for this task include the following:

  • Add this option to the menu.
  • Add the code/process into a subroutine.
  • Use an array to store the list of processes that need to be reviewed and killed.
  • Process the kill using the array.

Next, you have been asked by different users to explain how to compile a program in a UNIX environment.

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

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

#include <stdio.h> <stdio.h>
#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
*/

(College of Science and Technology, n.d.)

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”?

Finally, compare and contrast the usage of a compiled and interpreted program.

 

Solution:

15% off for this assignment.

Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!

Why US?

100% Confidentiality

Information about customers is confidential and never disclosed to third parties.

Timely Delivery

No missed deadlines – 97% of assignments are completed in time.

Original Writing

We complete all papers from scratch. You can get a plagiarism report.

Money Back

If you are convinced that our writer has not followed your requirements, feel free to ask for a refund.

WeCreativez WhatsApp Support
Our customer support team is here to answer your questions. Ask us anything!
👋 Hi, how can I help?