Write a program which displays four options to the user

Assignment Help Programming Languages
Reference no: EM131336727

Linux Script 1

Requirements

Create a new file called week5prog1.sh with vi or pico editor.

Edit your new file using VI and change it so it performs 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

2. Run the script and show the output here

Linux Script 2

Requirements

Create a new file called week5prog2.sh with vi or pico editor.

Edit your new file using VI and change it so it performs 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, display that Mary is an user in this system

• Otherwise display that Mary is not in the system

You need to use "grep", "if" , "else" "$?"

Source Programs:

Insert your source code here.

$ cat week5prog2.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

Linux Script 3

Requirements

Here is the question:

Some commands like cp, mv, mkdir need arguments. Similarly this script needs only two arguments. If user enters no arguments or one argument or three or more than 3 arguments, it displays error message like "You need to enter 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 host name "hostname " command

• Display your username using system variable "USER"

• If user enters no arguments or one argument or three or more than 3 arguments, it displays error message like "You need to enter two arguments "

• If user enters two arguments, it displays the arguments in reverse order .

Source Programs:

Insert your source code here.

$ cat week5prog3.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

A. $ week5prog3.sh

B. $ week5prog3.sh Tom

C. $ week5prog3.sh Tom David Smith

D. $ week5prog3.sh Tom David

Linux Script 4

Requirements

Create a new file called week5prog4.sh with vi or pico editor

Here is the question:

Write a program which displays 4 options to the user and asks the user to enter one option and displays the output depending on the choice. If the user enters any other character, display error message that he has to enter only a, b, c or d

a. Current date and time

b. No of users currently logged 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 inputs each time when the scripts prompts like

1st Run : Enter an option : a

2nd Run : Enter an option : b

3rd Run : Enter an option : c

4th Run : Enter an option : d

5th Run : Enter an option : x

Reference no: EM131336727

Questions Cloud

Create subclass name shippedorder that override computeprice : Create a subclass named ShippedOrder that overrides computePrice() by adding a shipping and handling charge of $4.00. Write an application named UseOrder that instantiates an object of each of these classes.
Oligospermia due to efferent duct obstruction : For the statement "oligospermia due to efferent duct obstruction" the main term to reference in the Index is __________
Spontaneous and negotiated sources of short term credit : How is the annual financing cost for a short-term financing source calculated? How does the annual financing cost differ from the true annual percentage rate?
Rules or properties of exponents : For this discussion board, you will each take the role of teacher. You will each choose ONE of the following rules or properties of exponents and teach it to the class (i.e., explain it in your own words and give an example that illustrates your e..
Write a program which displays four options to the user : Write a program which displays 4 options to the user and asks the user to enter one option and displays the output depending on the choice.
Company make when considering capital budgeting : Explain what capital budgeting is? Why is this important for a company? What errors might a company make when considering capital budgeting?
Which policy will produce the higher expected profitability : Why is no single working capital investment and financing policy necessarily optimal for all firms? What additional factors need to be considered in establishing a working capital policy?
What is the height h of water in the standpipe : If a circumferential stress of 32 MPa is measured in the wall at the bottom of the standpipe, what is the height h of water in the standpipe?
Discuss the probability versus risk trade offs : Discuss the probability versus risk trade-offs associated with alternative combinations of short-term and long-term debt used in financing a company's assets.

Reviews

Write a Review

Programming Languages Questions & Answers

  Read data from a file into our program and search by title

I need help getting the data from the data file to work correctly with the program. Please see the attached documents.

  Determine if a word is a palindrome

Determine if a word is a palindrome. Using a doubly link list read in a word character by character Store each character in its own node. Keep a counter of the number of characters that make up the word.

  Class to create and draw five squares

Now write applet DrawSquares that uses your Square class to design and draw 5 squares. This code must be very simple.

  Modularizing code and sorting techniques

Modularizing Code and Sorting Techniques-Imagine you are a part of a team that is tasked with writing a mobile application (app) that will allow users to send pictures to their friends

  Write a program to ask the user to enter the amount spent

Write a program to ask the user to enter the amount spent on food and Gas for each day of the week. Count and display the number of days the user spent more than 20 dollars per day on food and more than 10 dollars/per day on gas.

  Card generator program by linked list

Address Book-Card Generator Program Using a Linked List. This program will have names and addresses saved in a linked list. In addition, a birthday and anniversary date will be saved with each record.

  Design electronic submission of assignments from students

This system must manage electronic submission of assignments from students to instructors. It must keep track of which students have submitted assignments and must allow instructors to manage the grading.

  Build a student record managing system application

Build a student record managing system application

  Discuss the business ethics to promote ethical behaviour

Discuss the business ethics (concept, common issues, ethical decision factors), actions to promote ethical behavior, social responsibility (concept/dimensions, consumerism), and the business legal environment (source of law, resolution of disputes..

  Write class to hold hourly rate of pay

Write down the class which comprises variables which hold your hourly rate of pay and number of hours that you worked. Illustrate your gross pay.

  Advantages of separating logic from presentation

What are the advantages of separating logic from presentation? What are the differences between using the Dispatcher synchronously and asynchronously

  Write program which reads in weight in pounds and ounces

Write the program which reads in the weight in pounds and ounces and putputs equivalent weight in kilograms and grams. Utilize at least three functions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd