Finals Flashcards
(36 cards)
Allows for an automatic commands execution that would otherwise be executed interactively one by-one.
Scripting
Is a macro processor that allows for interactive or non-interactive command execution.
Shell
Meaning of “BASH”?
Bourne Again Shell
Command-line language. Open-source version of the Bourne Shell and was first released in 1989.
Bash
Text file containing instructions to be executed in order from top to
bottom.
Bash Script
How are script files created?
vim, gedit, and emacs.
Starts the shell script
!/bin/sh
Symbol is used for comments.
#
Used to display text and variable output.
echo
Allow a programmer to store data, alter and reuse them throughout the script.
Variables
Variable that is present within the current instance of the shell
Local Variable
Special variable that is set by the shell and is required by the shell to function correctly.
Shell Variables
Available to any child process of the shell.
Environment Variables
Filename of the current script.
$0
These variables correspond to the arguments with which a script was invoked
$n
The number of arguments supplied to a script.
$#
The exit status of the last command executed.
$?
The process number of the current shell. For shell scripts, this is the process ID under which they are executing.
$$
The process number of the last background command.
$!
Divides left-hand operand by right-hand operand and returns the remainder
% (Modulus)
Assigns right operand in the left operand
= (Assignment)
Compares two numbers, if both are same then returns true
== (Equality)
Compares two numbers, if both are different then returns true
!= (Not Equality)
Checks if the value of two operands are equal or not; if yes, then the condition becomes true
-eq