Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(LINUX) LAB 1 Log on and open a terminal window. and confirm that you're running bash with the ps command. Run the command that gives

(LINUX) LAB 1

Log on and open a terminal window. and confirm that you're running bash with the ps command.

Run the command that gives you a list of all the environment variables that are currently set.

Using a pipe to the wc command, find out how many environment variables are currently set.

Create a new environment variable called MYVAR and set its value to "myvalue". Use the command export MYVAR to allow MYVAR to be used by sub-programs of the shell. Verify that this step worked by printing out the value of MYVAR on the terminal. Also repeat step 3 to ensure that the number of variables increased by 1.

Try changing your command prompt to:

"prompt> "

nothing

your username

the output of the date command followed by "$ " (tricky)

Write shell program called hello to print hello, world on the screen. Try running this program from your home directory by typing hello at the prompt. This won't work; you need to use the absolute path to run the program - try this now. Now change the environment variable called PATH so that you can run hello without an absolute path from anywhere.

Print the value of the environment variable called HOSTNAME. If it's not currently set, set its value to be the name of the machine you're working on (without using that exact name in the command you type). Verify that HOSTNAME was set correctly.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago