Shell Scripting Flashcards
1
Q
$?
A
- it gives the status of the last command executed
- if the command was successful, $? will contain 0, else a non-zero value
2
Q
What is Shell?
A
- it’s basically a command-line interface to the Unix system
- it is a medium provided to interact with the kernel, which is a CLI to the Unix system
3
Q
Types of Shells
A
- Bourne shell
- C shell
4
Q
Bash export
A
- it is a built-in command of the Bash shell
- it designates specified variables and functions to be passed to child-process
5
Q
> operator (right-angle bracket)
A
- output redirection
- redirect the output from a command typically into a file
- it overwrites any existing data in the file
6
Q
stdout
A
- the standard output
- it is usually the terminal window
7
Q
> > operator
A
- regular output append
- adds the output to the existing content instead of overwriting it
8
Q
What is a .sh file?
A
- Bourne shell script
- it is a computer program designed to be run by the Unix shell, a command-line interpreter
- Typical operations performed by shell scripts include file manipulation, program execution, and printing text.
9
Q
!/usr/bin/ksh
A
- a hashbang or shebang
- it tells Unix that this script should be run through the /bin/bash shell
10
Q
umask
A
- user file-creation mode
- it lets you set up default permissions for newly created files and folders