Create a script that uses case logic

Assignment Help C/C++ Programming
Reference no: EM13758566

Display the command(s) used to do the following: create a script that uses case logic to have someone guess your...

Display the command(s) used to do the following: create a script that uses case logic to have someone guess your favorite sandwich, such as tuna. Show results.

Display the command(s) used to do the following: display the cclontents of .bashrc file. Next, use the vi editor to edit that file and put in an alias so that you see a long file listing of a directory every time you type list. Show results.

Display the command(s) used to do the following: use a command to simulate how you would troubleshoot a problem with the sandwich script you created in the question above. Show results.

What is wrong with the following lines of code?

While [ "$value" = "100" ; do

Echo "That's a large number." read value

Fi

There does not need to be a [

While and echo are capitalized

It only works on the number 100 Display the command(s) used to do the following: write a script that creates the following menu using a while loop and tput command:
Soup Menu
(t)omato
(b)ean
(s)quash

Select a soup ... (q) to quit

Show results.

What are the exit statuses of the test command discussed in this chapter and what do they mean? How can you view the exit status results of the test command directly from the command line? Show results.

Display the command(s) used to do the following: create a variable called mem_size and set its contents to 1024. Next, use the test command to determine if the contents of mem_size is less than or equal to 512. Show results.

Display the command(s) used to do the following: set your shell from the command line to be the bash shell. Then, use the echo command to verify the contents of the shell variable. What is now contained in the shell variable?

Use the test command to evaluate whether the shell variable contains a reference to the bash shell and use the echocommand to determine the result. (Note that this provides one way to verify from within a script that the script user is set up to use the bash shell.).

Show results.

Display the command(s) used to do the following: make your home directory your current working directory. Use the vi or Emacs editor to create the veg_choice script below. Enter a line in that script to ensure the script uses the bash shell. Run veg_choice to ensure your change works properly. Show results.

echo -n "What is your favorite vegetable?"
read veg_name
if test $veg_name = "broccoli"
then
echo "Broccoli is a healthy choice."
else
if [ "$veg_name" = "carrots" ]
then
echo "Carrots are great for you."
else
echo "Don't forget to eat your broccoli also."
fi
fi

Edit the veg_choice script again but, this time, change the line: if [ "$veg_name" = "carrots" ] to use the test command. Show results.

Display the command(s) used to do the following: create a shell variable that outputs the calendar for the current month (call it CALNOW).

How could you set up CALNOW so that it works every time you log in using the bash shell?

Show results.

Display the command(s) used to do the following: in your source directory, write a script called "them" in which you create a function called whoisthere that displays a listing of who is logged in and displays the column headings for the information displayed.
Make the contents of your "them" script resident in memory and test your whoisthere function.

Modify your whoisthere function so that you can enter "These are the folks logged in:" as an argument to appear before you list who is logged into the system.
What actions do you take next to use the whoisthere function with your modifications?
How can you set up your new whoisthere function so that it can be run each time you log in using the bash script?

Show results.

Troubleshoot the problems with the following script (there are 6 errors/corrections. Describe them below):
Script Name: record_entry
By: TRJackson
looptrack=y
while [ "$looptrack" = 1 ]
do
echo -n "Type in the account number:" read account
echo -n "Type the first and last name:" ; read full_name
echo -n "Type the age:" red age
echo -n "Enter another record?" ; read looptrack
finish

Reference no: EM13758566

Questions Cloud

Determine the weekly production schedule : Hawaii sugar company produces brown sugar, white sugar, powdered sugar and molasses from sugar cane syrup. the company purchases 4000 tons of syrup weekly and is contracted to deliver at least 25 tons weekly of each type of sugar.
Falsely accuses her of embezzling : Mike sends a letter to Michelle in which he falsely accuses her of embezzling. This is defamation if the letter is read by: A) a public figure B) any third person C) Michelle D) only Michelle's employer or potential employer
Machiavellianism-aristotles virtue ethics : Tim works for the public relations department of Alpha Sales Company. His job includes putting a good face and positive spin on the company's successes as well as its failures. Machiavellianism. Aristotle's Virtue Ethics
Write a paper on modernism and two modernism authors : Write a 8-10 page paper on Modernism and 2 modernism authors and their works.
Create a script that uses case logic : Display the command(s) used to do the following: display the cclontents of .bashrc file. Next, use the vi editor to edit that file and put in an alias so that you see a long file listing of a directory every time you type list.
Extremely busy law firm specializing in litigation : Emmanuel and Petersen is an extremely busy law firm specializing in litigation. In order to keep up with their workload, they refuse to hire anyone as a secretary who is unable to type at least 65 words per minute. If a group of male applicants chall..
Five stages of the small business life cycle : Explain the strategies you would use to ensure your company is successful at each of the five stages of the small business life cycle. Explain risks and opportunities associated with each of the five stages of the small business life cycle.
Producer of servomechanisms has four major components : One of the industrial robots designed by a leading producer of servomechanisms has four major components. Components' reliabilities are .97, .96, .94, and .92, and all these components must function in order for the robot to operate effectively. Desi..
Describe some of the challenges linda brent faced : describe some of the challenges Linda Brent faced while she lived under Flint; there are many and they are varied in complexity.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Design an algorithm to find the selling price

To make a profit, the prices of the items sold in a furniture store are marked up by 60%. Design an algorithm to find the selling price of an item sold at the furniture store. What information do you need to find the selling price?

  Prepare a program for a bank that allows the user

Prepare a program for a bank that allows the user to enter an amount of money in cents. Show the number of whole dollars the bank will give the customer in exchange.

  Calculate the gpa of 5 courses

Write a C++ program to calculate the Gpa of 5 courses. When users enter the grades and credits of the courses from the keyboard, the program will calculates the GPA and displays it on the screen. Can you prepare this program in C++ language? Defin..

  Using songs.dat in our folder

Using songs.dat in our folder on the P: drive, construct a playlist of 10 random songs. Use a struct to hold the song data (name and time in seconds), and output the playlist (song name and time,

  Problem related to stroing of text file values into vector

I have to store the text file values into a vector and do the sum, here the text file sample: Expenses: Equipment:$300 Food: $50  Consumable expenses: $100

  Powers of a user specified range of integer numbers

Write a C program to print a table of the powers of a user specified range of integer numbers. The program should also print the sum of the powers of the numbers.

  Write a small program scropy

You are supposed to write a small program scropy, which takes two arguments on the command line: the names of a source file and a destination file.

  Explain function which builds the multi-dimensional vector

A separate function which outputs the multi-dimensional vector to the screen.

  Task 1 fill out surveyplease take the 122223 survey at

task 1 fill out surveyplease take the 122223 survey at survey.osble.orgindex.php?sid97282. please treat the question

  Write a program that simulates an airplane race

Program will use a function that has the following parameters: time and acceleration and function will pass back two data items: speed and distance.

  Initialize an array and fill the array with the gpa values.

Write a program in java that asks user input (using a loop) for name of 10 student and the corresponding grade point averages (GPAs). Initialize an array and fill the array with the GPA values.

  Square root of a number n

USING C++ the square root of a number N can be approximated by repeated calculation using the formula NG=.5(LG+N/LG) where NG stands for next guess and LG stands for last guess

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