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
2
Q
Run script.sh with debugging.
A
bash -x script.sh
3
Q
Reassigns the output of a command as an argument to another command.
A
command substitution
4
Q
Run script.sh, which is not executable, by spawning a new shell to run the script in.
A
sh script.sh
5
Q
Path to the system’s default shell.
A
/bin/sh which is often a symbolic link to /bin/bash
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.
7
Q
Get a script’s return value.
A
$?