Environment Variables in Unix
18 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the correct way to change the value of a variable in a shell?

  • Use the set command to update the variable value
  • Specify the variable name followed by a colon and the new value
  • Use the env command to update the variable value
  • Specify the variable name followed by an equal sign and the new value (correct)

What is the purpose of the UMASK variable in the BASH shell?

  • It lists all exported environment and user-defined variables
  • It performs a specialized function in the shell and must be set by the alias command
  • It sets the default permissions for newly created files (correct)
  • It is used to create shortcuts to commands

What is the name given to temporary shells created by the current shell?

  • Parent shell
  • Sibling shell
  • Subshell (correct)
  • Child shell

Which of the following characters is NOT allowed as the first character of a variable identifier?

<p>Number (B)</p> Signup and view all the answers

What is the purpose of the alias command?

<p>To create and view shortcuts to commands (C)</p> Signup and view all the answers

What is the convention for capitalizing variable identifiers?

<p>They are typically capitalized (A)</p> Signup and view all the answers

What is the purpose of the less command in the pipeline ls –l /etc | less?

<p>To view the output of the ls command page by page (B)</p> Signup and view all the answers

What type of variable is defined by the user in a BASH shell?

<p>User-defined variable (A)</p> Signup and view all the answers

What command is used to view the contents of a specified variable in a BASH shell?

<p>echo command (D)</p> Signup and view all the answers

What type of variables are useful when executing commands and creating new files and directories in a BASH shell?

<p>Special variables (B)</p> Signup and view all the answers

What is the purpose of the pipe character (|) in a command?

<p>To connect multiple commands together (C)</p> Signup and view all the answers

Where are environment variables set by default in a BASH shell?

<p>In the BASH shell itself (D)</p> Signup and view all the answers

What happens to variables stored in memory when you exit a BASH shell?

<p>They are destroyed along with the shell itself (A)</p> Signup and view all the answers

What is the purpose of environment files in BASH?

<p>To make variables accessible at all times (B)</p> Signup and view all the answers

What is the first line in a shell script called?

<p>Hashpling (C)</p> Signup and view all the answers

How can you execute a shell script if you have read permission to it?

<p>By starting another BASH shell and specifying the script as an argument (C)</p> Signup and view all the answers

What is required to execute a shell script like any other executable program on the system?

<p>Both read and execute permission (C)</p> Signup and view all the answers

What is the issue with the output shown in the text?

<p>The output from each command is not separated by blank lines or identified by a label (A)</p> Signup and view all the answers

More Like This

IT1917 Linux Environment Quiz
6 questions

IT1917 Linux Environment Quiz

PersonalizedIrrational avatar
PersonalizedIrrational
Mac OS Environment Setup
10 questions
Shell Scripting Essentials
78 questions
Use Quizgecko on...
Browser
Browser