Shell Scripting

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/30

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

31 Terms

1
New cards

echo

it is the Bash Shell output mechanism:

2
New cards

echo

prints arguments to standard output separated by spaces

Prints the text you give it, then moves the cursor to the next line.

3
New cards

echo -n argument

no trailing newline after output

Prints the text but keeps the cursor on the same line. It Negates the automatic newline.

4
New cards

echo -e argument

interpret \char escapes

It tells echo to Enable the interpretation of special codes (called "escape sequences") that start with a backslash (\).

5
New cards

echo -E argument

do not interpret \char escapes

Explicitly tells echo to not interpret the escape sequences; it prints them Exactly as they are.

6
New cards

\a Alarm

ring the terminal bell

7
New cards

\b

Backspace

8
New cards

\c

print without trailing newline (same as print -n)

9
New cards

\f

Form feed

10
New cards

\n

Newline

11
New cards

\r

Return

12
New cards

\t

tab

13
New cards

\v

vertical tab

14
New cards

\\

Backslash

15
New cards

\xxx

Character with octal code (up to three octal digits)

16
New cards

read

To get input while a Shell Script is running

allows you to prompt for input and store it in a variable.

17
New cards

shell script or shell program

Shell program interprets user commands, which are either directly entered by the user, or which can be read from a file called

18
New cards

interpreted

Shell scripts are _______, not compiled

19
New cards

shell scripts

reads commands from the script line per line and searches for those commands on the system while a compiler converts a program into machine readable form, an executable file – which may then be used in a shell script.

20
New cards

#!/bin/bash

this an optional comment use to indicate will interpret by the bash shell.

21
New cards

echo

command displays the string, variables or arguments form the parameters.

22
New cards

sleep

command serves as a delay or pause for the next instructions or commands. [delay in seconds]

23
New cards

let argument

a built-in Shell command performs long integer arithmetic

24
New cards

let argument

approximately 10 times faster than expr

Evaluates each argument as an arithmetic expression

No quotes for special characters, or arguments with spaces or tabs

25
New cards

bc -

performs floating point arithmetic

acts as a filter command or interactively

reads arithmetic expression strings from standard input or specified file

semicolons or new lines separate expressions

set the scale variable inside bc to define the required number of decimal places

26
New cards

$

Variables need no 

27
New cards

0 (True)

The command completed without errors.

28
New cards

1 (False)

The command encountered an error (e.g., file not found, bad permissions, wrong syntax, general error).

29
New cards

compiler

converts a program into a machine-readable, executable file.

30
New cards

user environment

main task of a shell is providing this, and it can be configured individually using shell resource configuration files.

31
New cards

bc -l

a shell script to compute a discount, which involves division and decimals

ensures that the bc program is ready for precise floating-point math, handling the division correctly even if the numbers were more complex