105.2 Customize Or Write Simple Scripts Flashcards

1
Q

Produces a sequence of numbers for a loop.

A

seq
e.g.
for i in $(seq 5000) ; do echo $i ; done

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

Run script.sh with debugging.

A

bash -x script.sh

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

Reassigns the output of a command as an argument to another command.

A

command substitution

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

Run script.sh, which is not executable, by spawning a new shell to run the script in.

A

sh script.sh

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

Path to the system’s default shell.

A

/bin/sh which is often a symbolic link to /bin/bash

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

Line that identifies the script’s interpreter.

A

The shebang #! line, which is always the first line in a script.
e.g.
#! /bin/sh
If left out, the script runs in the system’s default shell.

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

Get a script’s return value.

A

$?

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