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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Types of Shells

A
  • Bourne shell

- C shell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

stdout

A
  • the standard output

- it is usually the terminal window

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

> > operator

A
  • regular output append

- adds the output to the existing content instead of overwriting it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

!/usr/bin/ksh

A
  • a hashbang or shebang

- it tells Unix that this script should be run through the /bin/bash shell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

umask

A
  • user file-creation mode

- it lets you set up default permissions for newly created files and folders

How well did you know this?
1
Not at all
2
3
4
5
Perfectly