UOP POS 433 Week 5 Linux Script Worksheet NEW
Home Posted Questions Library

UOP POS 433 Week 5 Linux Script Worksheet NEW

image
Saurav
(0)
Description

UOP POS 433 Week 5 Linux Script Worksheet NEW

Linux® Script 1 (2 Marks)

Requirements
Create a new file called week5prog1.sh with vi or pico editor.
Edit your new file using the following actions:
• Display the date
• Display your system information using "uname -a" command
• Display your username and id using "id" command
• Display your current directory
Save the file and type your file name to execute.

Source Programs:
Insert your source code here.

$ cat week5prog1.sh

Output Results:
Insert the output here. Use a screen shot of the output with input requirements specified in the assignment.

  1. Give execute permission to the user, group only
    Run the script and show the output here

 Linux® Script 2 (2 Marks)

Requirements
Create a new file called week5prog2.sh with vi or pico editor.
Edit your new file using the following actions:
• Display the date
• Display your system information using "uname -a" command
• Display your username and id using "id" command
• Change your directory / tmp
• Display your current directory
• Search Mary in the passwd file in / etc directory
• If the search is success, that is
Mary is not in the system
You need to use "grep", " if "," else "" $? "

Linux® Script 3 (3 Marks)

Requirements
Here are
some commands like cp, mv, mkdir need arguments. Similarly, this script needs only two arguments. If user enters two arguments, it displays the arguments in reverse order.
Create a new file called week5prog3.sh with vi or pico command
Edit your new file using vi and write the script: Create a new file called week5prog3.sh with vi or pico command.
• Display the date
• Display your system's hostname "hostname" command
• Display your username using system variable "USER"
• If user enters 
two arguments, it displays the arguments in reverse order.

Linux® Script 4 (3 Marks)

Requirements
Create a new file called week5prog4.sh with vi or pico editor
Here are the questions:
Write a program which displays 4 options to the user and asks the user to enter. If the user enters any other character, the display error message that he has to enter only a, b, c or d
a. Current date and time
b. No of currently registered in
c. List of directories in PATH variable
d. Your login name using "LOGNAME" variable
 (hint: Use the case statement and read the option with read command)

Source Programs:
Insert your source code here.
$ cat week5prog4.sh
Output Results:
Insert the output here. Use a screen shot of the output with input requirements specified in the assignment.
1. Give execute permission to the user, group only
2. Run the script and show the output here with the following input each time when the scripts prompts like

1st Run: Enter at Option:
2nd Run: Enter at Option:
3rd Run: Enter at Option:
4th Run: Enter at Option:
5th Run: Enter at Option: x

Recommended for you

Reviews & Feedback

Average rating 0.0 based on 0 review(s).


5 Stars
(0)
4 Stars
(0)
3 Stars
(0)
2 Stars
(0)
1 Stars
(0)

No Reviews Yet.

Basic Information

Price
4.99
Uploaded on
Jan. 15, 2023
Subject
Computer Science
Course Code
pos420
Attachments
1 Files
Institution
None