Question

Open vi or pico and create a script called Information.   Add the contents from the following table to the script: (Hin...

  1. Open vi or pico and create a script called Information.   Add the contents from the following table to the script: (Hint: use echo to add blank lines to your output and to write out the headings).

Headings:

Utilities (command to execute)

Today’s date is:

date

The current users logged on to the system are:

who

My current startup directory is:

pwd

Today’s identification information is:

id

The processes running on my system are:

ps

  1. Add a header to your Information script file that contains a description of what the program does, your name, and date.
  2. Save the file, set the file permissions to allow execution.
  3. Execute the script and redirect the output to a file called DailyInfo

Copy and paste the Information script and the DailyInfo file. With Vi visual example please.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

//information.sh script

//information.sh

echo "Name: Your name"

echo "Date: 06/01/2019"

echo "#####Information script#######"

echo "Script prints"

echo "1. Today's date"

echo "2. The current users logged on to the system"

echo "3. My current startup directory"

echo "4. Today’s identification information"

echo "5. The processes running on my system"

echo "@@@@@@@Output@@@@@@@@@@"

echo "1. Today’s date is: `date`"

echo "2. The current users logged on to the system are : `who`"

echo "3. My current startup directory is: `pwd`"

echo "4. Today’s identification information is: `id`"

echo "5. The processes running on my system is: `ps`"

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

//after saving the file as information.sh , change the permission of the file to execute by executing below command

chmod +x information.sh

now execute the below command

./information.sh > DailyInfo

You can check the DailyInfo file for output of the program

vi DailyInfo

Name: Your name
Date: 06/01/2019
#####Information script#######
Script prints
1. Today's date
2. The current users logged on to the system
3. My current startup directory
4. Today’s identification information
5. The processes running on my system
@@@@@@@Output@@@@@@@@@@
1. Today’s date is: Sat Jun 1 03:53:15 UTC 2019
2. The current users logged on to the system are :
3. My current startup directory is: /home/runner
4. Today’s identification information is: uid=1000(runner) gid=1000(runner) groups=1000(runner)
5. The processes running on my system is: PID TTY TIME CMD
156 pts/0 00:00:00 bash_interp.sh
157 pts/0 00:00:00 bash
176 pts/0 00:00:00 bash
181 pts/0 00:00:00 ps

Add a comment
Know the answer?
Add Answer to:
Open vi or pico and create a script called Information.   Add the contents from the following table to the script: (Hin...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Objective : Write a C Shell script which copies all files(*.java and *.class) from your home dire...

    Objective : Write a C Shell script which copies all files(*.java and *.class) from your home directory to a new one, and Analyze the new directory information such as number of files, user permissions, and disk usage. Sample Output:                                                    << CS Directory Analysis >>      Date:   ============================================================ Current Directory: /home/tomss New Directory Created : /home/tomss/pgm01 File information Total Number of files : 22 files Directory files:   0 files Plain text files:   10 files File have read permissions: 3 files File have...

  • (In Linux) 1. Create a file to write to from your script and save it as...

    (In Linux) 1. Create a file to write to from your script and save it as “.txt”. 2. Write the following information to the file that you created in Step 1: Today's date Your full name Your student ID The name of your course What directory you are in File permissions of the file that you created that allow everyone to read, write, and execute The long list of files in your current directory, providing all items and their process...

  • 1. Write the command to set the following permissions on a script file with the following...

    1. Write the command to set the following permissions on a script file with the following name; myscript.sh Owner: full access; read, write and execute Group: read and execute Other: no access 2. Create a new file with the name "myfirstscript.sh". Write a new script that performs the following tasks in sequence; Display the usernames of currently logged in users; sorted from a-z HINT: You will need to filter the output of the whocommand Display a list of usernames who...

  • In this exercise, you will create a script called file_ops.sh that uses the various file operators...

    In this exercise, you will create a script called file_ops.sh that uses the various file operators The file_ops.sh script will Use one command line argument Use four IF THEN statement to compare the first command line argument Determine which file operators to use that produces the following output when the script run with the arguments shown WARNING: In the IF THEN statements, to avoid syntax error messages, there must be a space before and after each bracket and also between...

  • Write a shell script to solve the following business problem. Create a file called whoislogin.out...

    Write a shell script to solve the following business problem. Create a file called whoislogin.out that contains the output of the who command, then append to the whois.out file, the output of the date and finger commands. Your script should prompt to pick any users from the list of users currently logged onto the system. Use the variable concept to search for the specific user from those displayed on the screen coming from the who is.out file created. Show a...

  • Copy/Paste your script from 5b here. 4. Let's look at a more complicated script executable. a....

    Copy/Paste your script from 5b here. 4. Let's look at a more complicated script executable. a. Write the following as script6.sh and change its permissions to count for num in d do if num eq 100 then count (count+1) done echo The number 10 was found $count times What is the output? Run the script as ./script6.sh 10 20 30 10 40 20 50 10 60 <enter Summarize what the script does r using the read command. The following script...

  • Hi I beed this assignment to be in a script in linux from codio. Can someone...

    Hi I beed this assignment to be in a script in linux from codio. Can someone please help me step by step thank you. Overview: In this milestone, you will demonstrate your ability to create a basic script in Linux. Review the Final Project Guidelines and Rubric document to see how this milestone will prepare you for the scripting portion of the project. You will perform this milestone in Codio in the unit called “Milestone 2: Scripting.” You will create...

  • Create a Windows batch script. The batch script will contain the following: Ask the user interactively:...

    Create a Windows batch script. The batch script will contain the following: Ask the user interactively: Boot drive letter of the computer Computer name Computer Model Check to see if the boot drive in #1 exists with the folder newfolder (#1 above) If yes cd BootDrive\newfolder If no, make the directory BootDrive\newfolder Check to see if casefile.txt exists: If yes goto the label DONE Tell the user that data already exists in the newfolder folder and exit the program Output...

  • LUNIX (Please Label) Exit vi (:q) and from the command line, type viscript4.sh. For this script,...

    LUNIX (Please Label) Exit vi (:q) and from the command line, type viscript4.sh. For this script, we will iterate through all files in the current directory print out their name using the for loop. Example (do not type yet): foriin*;do …;done where the…does some operation on$I, which stands for the current file. To do this, enter the following in your script4.sh file:           #!/bin/bash           for i in *; do                echo $i           done Once the above works, change the for loop to...

  • Create a file with the following information called presidents, using vi or pico, and again press the [tab] key between...

    Create a file with the following information called presidents, using vi or pico, and again press the [tab] key between fields. Once again, make sure you include the line numbers (6,7,8, etc) 6 Abe Lincoln honest 7 James Munroe doctrine 8 Harry Truman buck.stops 9 James Madison civil.war 10 Jimmy Carter peanuts Append presidents to people using cat, call the new file peopletwo. Enter the command used to do the append:__________________________________ Remove the line numbers and the first tab stop,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT