Index
Symbols
- ! (negation) operator, Discussion, Discussion
- !! (history) operator, Discussion
- !$ syntax, Solution, Solution
- !:1, !:2 syntax, Solution
- " " (double quotes)
- # (pound sign)
- #! (shebang), lines beginning with, Solution, Discussion
- $ (dollar sign), Solution
- $(( )) syntax, Discussion, Solution
- $() syntax, Discussion, Discussion, Discussion, Discussion
- $* variable, Solution
- $? shell variable, Solution, Discussion
- $@ variable, Solution
- $CDPATH variable, Problem
- $COMPREPLY variable, Discussion
- $FUNCNAME array, Discussion, Discussion
- $HIST* variables, Solution
- $IFS (bash internal field separator), Discussion, Discussion, Discussion, Solution, Discussion
- $INPUTRC variable, Solution
- $LESS variable, Solution
- $LESSOPEN and $LESSCLOSE environment variables, Solution
- different versions on different systems, Discussion
- $LINENO variable, Discussion, Discussion
- $OPTARG variable, Discussion
- $OPTION variable, Discussion
- $PATH variable (see $PATH shell variable, under P)
- $PROMPT_COMMAND, Discussion, Discussion
- $PROMPT_DIRTRIM, Discussion
- $PS0 prompt, Discussion, Solution
- $PS1 prompt, Solution, Discussion, Discussion
- $PS2 prompt, Discussion, Solution, Discussion, Solution
- $PS3 prompt, Solution, Discussion, Solution
- $PS4 prompt, Discussion, Solution, Solution
- $PWD variable, Discussion
- $RANDOM variable, Solution-Discussion
- $REPLY variable, Solution
- $TMOUT environment variable, Solution
- $TMP variable, Solution
- $UMASK variable, Discussion
- $VERBOSE variable, Discussion
- ${ } variable, Solution, Problem
- ${!prefix*} syntax, Discussion
- ${!prefix@} syntax, Discussion
- ${#VAR}, Discussion
- ${1:0:1} syntax, substring of a shell variable, Discussion, Problem
- ${:+} syntax, Solution
- ${:-} syntax, Solution
- ${:?} syntax, Solution
- ${VAR#alt}, Discussion
- % remainder operator, Discussion
- & (ampersand), running a command in the background, Solution
- && operator
- &> redirection operator, Discussion
- &>> redirection operator, Discussion
- ' ' (single quotes)
- (( )) double parentheses, Discussion, Discussion
- () (parentheses)
- * (asterisk), Problem
- ** operator, Discussion
- + (plus sign), Discussion
- , (comma) operator, Discussion
- , (comma), adding to numbers, Problem
- - (dash)
- - (minus sign)
- -1 argument, printf, Discussion
- . (dot)
- .* regular expression, Discussion
- ./ (dot slash) syntax, Discussion
- / (slash)
- 24-hour time, Discussion
- : (colon), Solution
- :+ variable operator, Discussion
- :- operator, Discussion, Discussion
- :; syntax, Discussion
- := (assignment) operator, Solution, Problem
- ; (semicolon)
- ;& syntax, Discussion
- ;; (double semicolon), ending statements associated with a pattern, Discussion
- < redirection operator, Discussion, Discussion
- 0<& or <& syntax, closing STDIN file descriptor, Discussion
- << indicating here documents, Solution
- <<- syntax, indenting here documents, Solution
- = (assignment) operator, Solution
- = (equality) operator, Problem
- string comparator in double-bracket syntax, Discussion
- = (equals sign), in arithmetic operations, Discussion
- == (equality) operator, Problem
- =~ operator, Solution, Discussion, Discussion
- >, redirecting output, Problem-Solution
- >> redirection operator, Solution, Discussion
- ? (question mark), matching any single character, Discussion, Discussion, Discussion
- ?( … ) syntax, Discussion
- @ (at sign)
- [ left square bracket, Discussion, Discussion
- [:alpha:] character class, Discussion
- [:blank:] character class, Discussion, Discussion
- [:digit:] character class, Discussion
- [:space:] character class, Discussion
- [@] notation, Discussion
- [[ ]] double brackets syntax, Discussion
- [] (square brackets)
- (backslash)
-
(newline)
- {n,m}, {n}, or {n,} in interval expressions, Searching with More Complex Patterns
- ^ (caret)
- `` (backquotes), Discussion, Discussion, Discussion
- {x..y} brace expansion, Discussion
- {} (curly braces)
- enclosing variable names, Solution, Discussion
- escaping in find command, Discussion
- forming more precise branching blocks with, Discussion
- grouping commands in a code block, Discussion
- grouping commands to run in subshell, Discussion
- in evaluation of shell variables, Discussion
- using in pattern matching to prevent alphabetization, Discussion
- using to group commands, Solution, Discussion
- | (pipe symbol), Discussion, Command-Line Processing Steps
- >| redirection syntax, Discussion
- linking sequence of multiple commands with, Solution
- logical OR in pattern matching, Discussion
- redirecting both standard output and standard error into a pipe, Discussion
- sending output to the next program, Solution
- swapping STDERR and STDOUT before pipe redirection, Solution
- using tee command in piped I/O, Solution, Discussion
- |& syntax, redirecting standard output and standard error into a pipe, Discussion
- || operator, Solution, Discussion
- ~ tilde expansion, Discussion
- ~, indicating home directory, Solution
- ~/bin directory, creating and adding to path, Solution
A
- -a (logical AND) operator, Solution
- -a option, type and which, Discussion
- absolute paths, Discussion
- administrative and housekeeping tasks, Housekeeping and Administrative Tasks-Discussion
- adding a prefix or suffix to output, Problem
- capturing file metadata for recovery, Problem
- circular backups, Problem
- clearing the screen on logout, Problem
- commifying numbers, Problem
- counting differences in files, Problem
- creating index of many files, Problem
- editing a file in place, Problem
- emulating DOS pause command, Problem
- finding lines in one file but not in another, Problem
- finding out if a process is running, Problem
- grepping ps output without getting the grep process, Problem
- keeping the most recent N objects, Problem
- logging an entire session or batch job, Solution
- numbering lines in files, Problem
- prepending data to existing file, Problem
- recovering disconnected sessions with screen, Problem
- removing or renaming files with special characters, Problem
- renaming many files, Problem
- sharing a single bash session, Problem
- unzipping many ZIP files, Problem
- using diff and patch, Problem
- using GNU info and Texinfo on Linux, Problem
- using sudo on a group of commands, Problem
- writing sequences, Problem
- writing to a circular log, Problem
- administrator accounts, Solution
- AIX, getting bash for, Discussion
- alias command, Solution
- alias expansion, commands, Discussion
- aliases, Discussion, Solution
- ANSI color escape sequences, ANSI Color Escape Sequences
- ANSI escapes in prompts, working around, Discussion
- appending output, Solution
- apropos command, Discussion
- archiving files, Solution
- Argument list too long errors, Problem
- arguments
- counting for a script, Problem
- getting default value of, Problem
- in printf statements, best practices for, Discussion
- parsing command-line arguments with case statement, Problem
- passed to a script, looping over, Problem
- printing to screen with echo, Discussion
- removing after handling in scripts, Problem
- reusing, Problem
- using output as, to connecting two programs, Problem
- ARG_MAX value, Solution, Discussion, Discussion
- arithmetic, Shell Logic and Arithmetic
- calculator using shell arithmetic and RPN notation, Problem
- creating a command-line calculator with floating-point arithmetic, Problem
- in awk, Discussion
- integer arithmetic in bash for loops, Discussion
- performing in a shell script, Problem
- while loop for arithmetic conditions, Solution
- with dates and time, Problem
- arithmetic expansion, Discussion
- arithmetic expressions, Discussion
- arrays
- associative arrays in awk, Solution
- associative arrays in bash, Solution
- parsing output into, Problem
- parsing words into, using read -a, Problem
- using an array with case conversion substitution, Solution
- using array variables, Problem
- arrow keys, using to scroll through commands, Solution
- ASCII
- Asciidoc, wrapper for tool, Discussion
- assignment operators, Discussion
- assignments
- awk utility, Intermediate Shell Tools I, Solution
- -F (field separator) option, Discussion
- calculator using floating-point arithmetic expressions from, Solution
- converting datafile to CSV, Solution
- counting string values, Problem
- creating histogram of some data, Problem
- parsing ifconfig output to find IP address, Discussion
- piping df command output into, Discussion
- piping ls output into and paring it down, Problem
- printing first word of lines of input, Solution
- printing out fields, Discussion
- reversing word order of input lines, Problem
- showing paragraph of text after found phrase, Problem
- summing a list of numbers, Problem
- using to combine or convert field separators, Discussion
- using to isolate fields in data, Solution
- using to number lines in a file, Discussion
- using to parse a CSV datafile, Solution
- using to trim leading or trailing whitespace, Discussion
- using to update fileds in a datafile, Solution
- using with last to add prefix or suffix to output, Solution
- writing sequences with, Solution
B
- background
- backups
- basename command, Discussion
- basename, using bash string manipulation for, Problem, Discussion
- bash, Beginning bash
- adding new features using loadable bulletins, Adding New Features to bash Using Loadable Builtins-Improving Programmable Completion
- building from source, Building bash from Source-Reporting Bugs
- compiled with --enable-coprocesses, Solution
- compiled with --enable-net-redirections, Solution
- computing and drawing a histogram, Problem
- configuring and customizing (see configuring and customizing bash)
- counting string values with, Problem
- decoding the prompt, Problem
- documentation, learning more about, Problem
- examples included with, Examples Included with bash-bash Documentation and Examples
- finding and running commands, Problem
- finding portably for #!, Problem
- getting for BSD-based systems, Problem
- getting for Linux, Problem
- finding bash versions for distributions, Discussion
- getting for macOS, Problem
- getting for Unix, Problem
- getting for Windows, Problem
- invoking, options for, bash Invocation
- keeping updated, Problem
- manpage for, Discussion
- -n option, Discussion
- network redirection, using to log to syslog from scripts, Solution
- new variables to support debugging as of version 3.0, Discussion
- philosophy, Intermediate Shell Tools I
- reasons for using, Why bash?
- reserved words, bash Reserved Words
- running in POSIX mode, Discussion
- setting as default shell, Problem
- trying out without buying or building, Problem
- version 3.2, Solution
- bash --version command, Solution
- bash-completion-20060301.tar.gz library, Solution, Discussion
- bashrc file, Solution
- $BASH_REMATCH variable, Discussion
- batch files, Solution
- Bazaar, Bazaar-Mercurial
- bc program, using as a coprocess, Solution
- bdiff utility, Solution
- BEGIN and END patterns (awk), Discussion
- BEGIN keyword, Discussion
- bg (background) command, Discussion
- /bin directory, creating and adding to path, Discussion
- bind command, Solution
- bit bucket, Discussion
- [:blank:] character class, Discussion
- bot or bottom (see aliases, for getting to the bottom of things)
- Bourne shell, Beginning bash, Why bash?
- branching on conditions, Problem-Problem
- break statement, Discussion, Discussion
- BSD-based systems, Discussion, Solution
- ARG_MAX limits, Discussion
- bash in /usr partition, Discussion
- chsh -l command, listing and editing shell, Solution
- echo command on, Discussion
- getting bash for, Problem
- hexdump utility, Discussion
- MAC implementation, Discussion
- on virtual machines, Discussion
- seq utility, Discussion
- which utility, Discussion
- buffer overflow attacks, Discussion
- buffering, buffered STDOUT versus unbuffered STDERR, Discussion
- builtin command, Discussion, Discussion
- using to avoid shell functions and aliases, Solution
- using to redefine a builtin command, Discussion
- builtin commands, Discussion
- builtins, loadable (see loadable builtins)
- bzip2 utility, Solution
C
- C language, code for loadable builtins, Discussion
- C shell (csh), Beginning bash
- call by value (exported variables), Discussion
- case
- case statement, Problem
- parsing command-line arguments with, Problem
- patterns in, following rules of pathname expansion, Discussion
- using in parsing arguments with getopts, Discussion
- using to validate input, Solution
- case..esac blocks, Discussion
- cat command, Discussion
- cd command, Discussion, Discussion
- cdrecord program, Solution
- CDs, burning, Problem
- character classes, Pattern-Matching Characters
- characters
- converting in text, Problem
- counting in a file using wc command, Problem
- chmod command, Solution
- chpass command, Solution
- chroot command, Solution
- chroot jails, Solution, Problem
- chsh -l command, Solution
- chsh -s command, Solution
- clear command
- putting in .bash_logout file, Solution
- setting trap to run on shell termination, Solution
- clobbering files
- cloud, getting free or low cost virtual machines, Discussion
- cmdhist option, Discussion
- cmp utility, Solution
- colors in prompts, Colors
- columnar data, fixed-width, cutting with cut -c, Discussion
- comm utility, Solution, Discussion
- comma-separated values (CSV)
- command alias, Solution
- command command, Discussion, Discussion, Discussion, Discussion
- command hash, clearing, Problem
- command keyword, prefixing commands with, Discussion
- command prompt ($PS1), Discussion
- command substitution, Solution, Discussion
- command-line arguments, Discussion
- command-line parameters, Discussion
- (see also arguments; parameters)
- using in shell scripts, Solution
- command-line processing, Command-Line Processing-eval
- commands
- builtin, reference listing of, Builtin Commands
- documentation, accessing, Discussion
- executing (see execution)
- finding and running under bash, Problem
- in if statements, Discussion
- not found, better error message for, Problem
- redefining with alias, Problem
- repeating the last command, Problem
- replacing built-in or external commands, Problem
- running almost the same command, Problem
- shortening or changing names of, Problem
- command_not_found_handle function, redefining, Discussion
- comments, documenting scripts with, Solution
- comparison operators, Discussion
- compgen command, Discussion, Discussion
- complete command, Discussion
- completion (programmable)
- compound commands, Discussion, Command-Line Processing Steps
- compress utility, Solution
- compressed files
- checking tar archive for unique directories, Problem
- using grep on, Problem
- compressing files, Problem
- concatenation, Discussion
- configuration files
- using external configuration files in scripts, Problem
- using in scripts with includes and sourcing, Problem
- configuring and customizing bash, Configuring and Customizing bash-Discussion
- adding new features using loadable builtins, Adding New Features to bash Using Loadable Builtins
- adjusting readline behavior using .inputrc, Problem
- adjusting shell behavior and environment, Problem
- changing your path permanently, Solution
- changing your path temporarily, Problem
- creating a better cd command, Problem
- creating and changing into new directory in one step, Problem
- creating self-contained, portable rc files, Problem
- customizing the prompt, Problem
- getting started with a custom configuration, Problem
- getting to the bottom of the directory structure, Problem
- improving programmable completion, Problem
- keeping a private stash of utilities by adding ~/bin, Problem
- prompt before the program runs, Problem
- setting shell history options, Problem
- setting your $CDPATH, Problem
- shortening or changing command names, Problem
- startup options, Problem
- synchronizing shell history between sessions, Problem
- using initialization files correctly, Problem-Problem
- when programs are not found, Problem
- control structures, Shell Logic and Arithmetic
- coproc command, Solution
- core dumps, preventing, Problem
- cp command
- CPIO files, Discussion
- cron utility, Discussion
- cross-platform shell scripts, Advanced Scripting
- (see also portable scripts)
- writing on Linux, problems with, Discussion
- crypt, Discussion
- CS_PATH, Discussion
- curl utility, Solution
- current working directory
- cut command, Solution, Solution
- CVE-2014-6271 (shellshock vulnerability), Discussion
- Cygwin, Why bash?
D
- daemon, running a script as, Problem
- dash (Debian Almquist shell), Solution
- $RANDOM variable and, Solution
- devscripts package for bashisms not working on dash, Discussion
- data injection attacks, Discussion
- data validation, Discussion
- databases, creating and initializing using MySQL, Problem
- date command, Working with Dates and Times
- (see also dates and time; GNU date)
- with -d or --date argument of tomorrow, Discussion
- dates and time, Working with Dates and Times-Discussion
- $HISTTIMEFORMAT variable, Discussion
- arithmetic with, Problem
- automating date ranges, Solution
- circular series, Discussion
- converting epoch seconds to, Problem
- converting to epoch seconds, Problem
- counting elapsed time, Problem
- finding files by date, Problem
- formatting for output, Problem
- getting yesterday and tomorrow's dates, using Perl, Problem
- handling time zones, Daylight Saving Time, and leap years, Problem
- in printf format, Examples
- logging with dates, Problem
- string formatting with strftime, Date and Time String Formatting with strftime
- supplying a default date, Problem
- using date and cron to run a job on the Nth day, Problem
- day of week, running a cron job on, Solution
- Daylight Saving Time, Working with Dates and Times
- dbiniter script, Solution
- Debian, Discussion, Discussion
- Debian Almquist shell (see dash)
- DEBUG signal, Discussion
- debugger, Bash Debugger Project, Discussion
- debugging, Advanced Scripting, Problem
- long sequence of piped I/O, Problem
- new variables to support debugging in bash 3.0, Discussion
- declare statements, Discussion
- -delete action (find), Discussion
- delimiters, Discussion
- cut command, using open and closed square bracket, Discussion
- /dev/null
- df command, Discussion
- dictionaries, Solution
- diff command, Discussion, Problem
- -p argument, Discussion
- -r and -N arguments, Discussion
- counting hunks in diff output, Solution
- finding lines in one file but not in another, Solution
- output, various forms of, Discussion
- treating all files as ASCII and setting language and time zone to universal defaults, Solution
- digits, matching, Discussion
- directories
- adding current directory to the $PATH, Problem
- commands for file information, adapting, Discussion
- commands in current working directory, prefixing with . (dot), Discussion
- creating and changing into new directory in one step, Problem
- getting to the bottom of the directory structure, Problem
- home directory, Solution
- in $PATH shell variable, Discussion
- in PATH environment variable in bash, Discussion
- movng quickly among, Problem
- providing for find command, Discussion
- showing which directory you are in, Problem
- to include in $CDPATH, Discussion
- dirname command, Discussion
- using string manipulation instead of, Problem
- dirs command, Discussion
- DistroWatch.com, Discussion
- divert program, Solution
- documentation
- documents, comparing, Problem, Discussion
- DOS files, converting to Linux format, Problem
- DOS pause command, emulating, Problem
- dos2unix program, Solution
- dot directory, Discussion
- dot files
- . and .. files, excluding from file listings, Solution
- showing all in current directory, Problem
- duplicates, removing, Discussion
- dynamic loading, using for loadable builtins, Discussion
E
- -e (exit) option, Discussion
- echo command, Discussion
- defined as an alias, Discussion
- echo -e command, Discussion
- echo -n command, Solution
- in configuration files, problems with, Discussion
- options and escape sequences, echo Options and Escape Sequences
- prefacing rm command with echo, Discussion
- quoting strings to preserve spacing in output, Problem
- redirecting output to a file, Discussion
- returning exit status, Discussion
- searching for secure temporary directory, Solution
- seeing what the shell will pass to scripts and functions, Discussion
- sending function output to STDOUT, Solution
- using echo * as alias for ls, Discussion
- using for shell output to terminal/window, Solution
- using portably in scripts, Problem
- using to see results of pattern match, Solution
- using to test file renaming, Discussion
- writing output without newline, Problem
- echoing
- ed utility, Solution
- editors, Discussion, Discussion, Solution
- elif clause, Solution
- elm, Discussion
- else clause, Solution
- Emacs mode commands, Emacs Mode Commands
- email
- empty strings, as valid default value for variables, Problem
- enable command, Discussion, Discussion
- enabling and disabling tty loadable builtin, Discussion
- END keyword, Discussion
- end-user tasks as shell scripts, End-User Tasks as Shell Scripts-Discussion
- env command, Discussion, Solution, Solution
- environment
- environment variables
- EOF (end of input) marker, Discussion
- escaping to turn off shell scripting, Solution
- leading characters preventing recognition of, Discussion
- not quoting in photo album script, Discussion
- trailing whitespace or characters preventing recognition of, Discussion
- epoch
- converting dates and time to epoch seconds, Problem
- converting epoch seconds to dates and time, Problem
- using epoch seconds for date and time arithmetic, Discussion
- eq operator, Problem
- equality, testing for, Problem-Problem
- determining which operator to use, Solution
- ERR signal, Discussion
- error messages
- displaying when command execution fails, Problem
- for case statement parsing arguments, Discussion
- giving for unset parameters, Problem
- handling in photo album script, Discussion
- including error output in tee output file, Discussion
- redirecting and appending to same file as output, Discussion
- redirecting to different files, Solution
- redirecting to standard error for a function, Discussion
- saving when redirect isn’t working, Solution
- searching for from previous command, using grep, Discussion
- sending to same file as output, Solution
- swapping STDERR and STDOUT before pipe redirection, Problem
- writing your own for parsing with getopts, Problem
- esac, ending case statements, Discussion
- escape sequences
- /etc/bashrc file, Discussion, Solution
- /etc/inputrc file, Solution
- /etc/passwd file, Solution
- /etc/profile file, Discussion, Solution
- /etc/shells file, Solution
- /etc/sudoers file, Solution
- etckeeper, etckeeper-Other
- eval command, eval
- ex utility, Discussion
- examples included with bash, Examples Included with bash-bash Documentation and Examples
- exec command, Discussion
- executables
- execute permissions on files, Discussion
- execution, Executing Commands-Discussion
- displaying error messages for failures, Problem
- exec for find utility, Discussion
- running a command only if another command succeeds, Problem
- running any executable, Executing Commands-Problem
- running commands from a variable, Problem
- running long jobs unattended, Problem
- running several commands in sequence, Problem
- success or failure of command execution, Problem
- using fewer if statements to check for command return codes, Problem
- exit statement, Discussion, Discussion
- exit status, Discussion
- adding exit 0 before documentation, Discussion
- assigning to a shell variable, Discussion
- exiting bash on encountering failure (nonzero exit status), Discussion
- getting value for, Discussion
- of statements in while loops, Discussion
- script terminated by signals, Solution
- using to run another command after first command succeeds, Solution
- expand_aliases option, unsetting, Discussion
- export command, Discussion
- export statements, Discussion
- exporting variables, Problem
- expecting to change exported variables, Problem
- extdebug option, Discussion
- extended pattern matching, Discussion, Discussion
- file globbing patterns and unzip utility, Solution
- external commands, Discussion
- forcing use before any builtins or functions, Discussion
- extglob option, Discussion, Discussion
- Extra Packages for Enterprise Linux (EPEL), Solution
F
- FAQ (bash), Official documentation
- fc command, Solution
- feature creep, Solution
- fg (foreground) command, Discussion
- fields, Discussion
- extracting from lines of input, Problem
- internal field separator environment variable (see $IFS, under Symbols)
- updating specific fields in a datafile, Solution
- using cut command to print out, Discussion
- file command, Problem
- file descriptors, Discussion, Discussion, Solution
- filename expansion, Discussion
- filenames
- as arguments to shell commands, Discussion
- containing odd characters, handling with find, Problem
- converting between upper- and lowercase, Problem
- file extensions and compression utilities, Solution
- getting from a search, Problem
- renaming files with wrong suffix, Problem
- shell parameters containing, quoting, Solution
- using bash for basename, Problem
- files
- capturing metadata for recovery, Problem
- clobbering on purpose, Problem
- compressing, Problem
- counting differences in, Problem
- counting lines, words, or characters in, Problem
- creating index of many files, Problem
- deleting using an empty variable, Problem
- displaying or using beginning or end of, Problem
- DOS, converting to Linux format, Problem
- editing in place, Problem
- finding, Finding Files: find, locate, slocate-Discussion
- finding lines in one file but not in another, Problem
- getting information about, Problem
- input and output, connecting program to, Standard Output
- keeping files safe from accidental overwriting, Problem
- naming for tar utility, Discussion
- numbering lines in, Problem
- on Unix, Standard Output
- prepending data to existing file, Problem
- reading entire file and then parsing it, Problem
- removing or renaming files with special characters, Problem
- renaming many files, Problem
- searching for string in, Problem
- showing all hidden (dot) files in current directory, Problem
- testing for characteristics, Problem-Problem
- uncompressing, Problem
- while loop for filesystem-related conditions, Solution
- with no line breaks, processing, Problem
- filters, Discussion, Intermediate Shell Tools II
- find command, Problem, Solution
- finding files across symbolic links, Problem
- finding files by content, Solution
- finding files by date, using -mtime predicate, Problem
- finding files by size, Problem
- finding files by type, Problem
- handling filenames with odd characters, Problem
- -l option, Discussion
- options for output format, Discussion
- speeding up operations on found files, Problem
- using -iname predicate to run case-insensitive search, Problem
- using GNU find and printf formats to capture file metadata, Solution
- using in alias to get to bottom of things, Discussion
- using output as arguments to rm command, Solution
- using with chmod, Solution
- using with head, grep, or other commands to index files, Solution
- using with xargs, Solution
- fingerprints, support by SSH, Discussion
- Firefox, script to back up and restore sessions, Discussion
- fixed-length records, processing, Problem
- adding newline after each record, Solution
- floating-point numbers
- arithmetic in awk using, Discussion
- calculator using floating-point arithmetic, Problem
- looping with floating-point values, Problem
- fmt command, Problem
- for loops
- awk language, Discussion
- converting filenames from upper- to lowercase, Solution
- integer arithmetic in, Discussion
- looping over arguments passed to a script, Solution
- looping with a count, Problem
- looping with floating-point values, Problem
- searching for files in several possible locations, Solution
- using "$@" in, Discussion
- using portably, Problem
- using to break up too-long argument lists, Solution
- using to rename many files, Solution
- using to unzip many files, Solution
- wrapping SSH command to run on multiple hosts, Solution
- forced commands (SSH), Solution
- fork(2) manpage, Discussion
- format specifications (printf), Discussion, printf
- formatting dates and time, Problem
- FORTRAN operators, similar to bash operators, Discussion
- Fox, Brian, Beginning bash
- FreeBSD, Problem, Discussion
- from host restriction, Solution
- $FUNCNAME array, Discussion, Discussion
- function reserved word, Discussion
- functions
- avoiding and executing the actual command instead, Problem
- avoiding command not found when using, Problem
- C functions for loadable builtins, Discussion
- date-related shell functions, Discussion, Solution
- defining, Problem
- func_mcd (example), creating and changing into a directory in one step, Solution
- parsing program output with a function call, Problem
- security measures for, Discussion
- turning off shell functions with command, Discussion
- using meaningful names for, Discussion
- using parameters and return values, Problem
- using to redefine how builtins work, Discussion
- using to rename or tweak commands, Solution
G
- gawk utility, Working with Dates and Times
- (see also awk utility)
- using to process fixed-length records, Solution
- getconf command, Solution
- getline command, Discussion
- getopt command, Parsing and Similar Tasks
- getopts command, Solution
- writing your own error messages for parsing, Problem
- Git, Git-Bazaar
- globbing (extended pattern matching), Discussion, Discussion
- file globbing patterns and unzip utility, Solution
- GNU awk (see gawk utility)
- GNU Core Utilities FAQ, Discussion
- GNU date, Working with Dates and Times
- GNU Readline library, Discussion
- GNU tar, Solution
- GNU tools, Discussion
- grep command, Discussion, Intermediate Shell Tools I
- -c option, Discussion
- finding files by content, Solution
- finding lines in one file but not in another, Solution
- forgetting to provide input for, Discussion
- getting just filename from a search, using -l option, Problem
- getting simple true/false from a search, Solution
- grepping ps output to find if a program is running, Solution
- grepping ps output without getting the grep process, Problem
- grepping the output of, Discussion
- -h option, Discussion
- -i option, Discussion
- ignoring case with -i option, Problem
- -o option, Solution
- paring down search finds, Problem
- piping df command output into, Discussion
- piping set command into, Discussion
- searching for text in a pipeline, Problem
- searching through files for a string, Discussion
- searching with more complex patterns, Searching with More Complex Patterns
- selecting lines beginning with ?, Discussion
- using in parsing HTML, Solution
- using instead of -name argument to find, Discussion
- using on compressed files, Problem
- using on output of svn status command, Solution
- using regular expressions with, Discussion
- using to count hunks in diff output, Discussion
- using with find, Solution
- using with find to index files, Solution
- -v option, Discussion
- grouping commands, using {}, Solution
- grouping symbols for extended pattern matching, Discussion
- gsub utility, Discussion
- removing whitespaces used in padding records, Solution
- guest users, restricting, Problem
- gunzip command, using augmented completion with, Discussion
- gzcat utility, Solution
- gzip utility, Solution
H
- -h (help) option, Discussion, Discussion
- hangup (hup) signals, Discussion
- hash -r command, Solution
- hashes, Solution
- head command, Solution
- using with find to index files, Solution
- header files
- headers, skipping in files, Problem
- help
- --help option, Discussion
- here documents, Solution
- escaping EOF marker to turn off shell scripting, Problem
- indenting, Problem
- using for documentation embedded in scripts, Solution
- hexdump -C command, piping output through, Solution
- hexdump.pl script, Discussion
- hidden (.dot) files, showing, Problem
- histappend option, Discussion
- histograms
- history
- initialization file for shell history, Solution
- setting shell history options, Problem
- synchronizing shell history between sessions, Problem
- history command, Solution, Problem
- history operator (!!), Discussion, Solution
- host alias, Solution
- host restriction, Solution
- hostnames, resolving to IP address, Solution
- hosts, finding external, routable address for, Solution
- housekeeping tasks (see administrative and housekeeping tasks)
- HP-UX
- HTML
- hunks (or chunks) in diff output, Discussion
I
- I/O (input/output), Standard Output
- (see also output)
- breaking up input into fixed sizes, Solution
- changing script behavior with redirections, Problem
- connecting program to files for, Standard Output
- getting input for script from another machine, Problem
- reference list of redirectors, I/O Redirection
- reversing word order in input lines, Problem
- standard input, Standard Input-Discussion
- using output as input to connect two programs, Problem
- validating external input, Solution, Problem
- while loop for reading input, Solution
- if statements, Solution-Discussion
- double parentheses around if expression, Discussion
- general form of, Discussion
- testing for file characteristics, Solution
- testing for more than one file characteristic, Problem
- testing for string characteristics, Solution
- testing with pattern matches, Solution-Problem
- testing with regular expressions, Problem
- tests in, and two kinds of syntax, Discussion
- using exit status in, Discussion
- running second command if first command succeeds, Solution
- using fewer to check for command return codes, Problem
- with elif and else clause, Solution
- if/then/else statement, Discussion
- using case statement instead of, Solution
- ifconfig utility, Solution
- output examples from different machines, Discussion
- in keyword, Discussion
- -iname predicate (find), Solution
- info command, Problem
- InfoZip packages, zip and unzip, Solution
- initialization files, Problem-Problem
- input preprocessors, Solution
- .inputrc file, Solution
- integer arithmetic, Solution
- integer arithmetic expressions, Discussion
- interactive mode, determining if shell is/is not running in, Problem
- internal field separator variable (see $IFS, under Symbols)
- interpreter spoofing attacks, avoiding, Problem
- interval expressions, Searching with More Complex Patterns
- IP addresses
- ISO 8601 standard for displaying dates and time, Discussion
- ISO filesystem images, Solution
- is_process_running script, Solution
L
- -L option (pwd and cd), displaying logical path, Discussion
- last command, Solution
- last in, first out (LIFO), Discussion
- lastpipe option, Solution
- leap years, handling, using tools for, Discussion
- less command, Discussion, Problem
- lesspipe script, Solution
- different versions on different systems, Discussion
- let statements, Solution
- LibreOffice, Solution
- line breaks, adding to a file, Problem-Problem
- line number ($LINENO), Discussion, Discussion
- lines, numbering, Problem
- Linux
- ARG_MAX limits, Discussion
- bash on, Why bash?
- chsh -l command, listing shells with, Solution
- converting DOS files to Linux format, Problem
- cross-platform shell scripts written on, problems with, Discussion
- /dev/null, Discussion
- echo command on, Discussion
- getting bash for, Problem
- prompt, example of, Solution
- root user, Discussion
- Security Enhanced Linux (SELinux) and MAC, Discussion
- sort order on, Discussion
- sudo on, Discussion
- using GNU info and Texinfo on, Problem
- Vixie-cron, Solution
- lithist option, Discussion
- loadable builtins, Adding New Features to bash Using Loadable Builtins-Improving Programmable Completion
- locales
- locate, Discussion, Solution
- logger
- using correctly, Problem
- using to send logging from scripts to syslog, Solution
- logging
- logical operators
- -a (logical AND) operator, Discussion, Problem
- -o (logical OR) operator, Problem
- logical AND operator in C, && and, Discussion
- logical AND, OR, and NOT constructs with find command, Discussion
- logical OR operator in C, || syntax and, Discussion
- logouts
- long lines of code, breaking, Discussion
- long-form command-line options, Parsing and Similar Tasks
- ls command, Discussion, Intermediate Shell Tools I
- accessing documentation on, Discussion
- command ls, Discussion
- ls -1 command, Solution
- ls -A, Solution
- ls -a, showing all files, Problem
- ls -d, Discussion
- piping into awk to limit output, Problem
- redirecting output to a file, using -C option, Solution
- Trojaned, Discussion
- useful options, Discussion
- using to get more information about a file, Problem
- lynx utility, Solution
M
- macOS
- mailers and message transfer agents (MTAs), Solution
- MAILTO variable, Solution
- man command, Discussion
- man in the middle attacks, Discussion
- mandatory access control (MAC) systems, Discussion, Discussion
- manpages, Discussion
- mapfile command, Solution
- Meld, Meld
- menus
- changing prompt in simple select menus, Problem
- creating a simple menu, Solution
- Mercurial, Mercurial-Subversion
- mkdir -m command, Solution
- mkdir command, Discussion
- mkisofs program, Solution
- mktemp utility, Discussion
- modulo, modulus, or mod (see % remainder operator)
- more command, Discussion
- MP3 files
- mpack, Discussion
- -mtime predicate (find), Solution
- mutt, Discussion
- mv command, Discussion, Discussion
- mysql command, Discussion
- MySQL, setting up databases, Problem
N
- {n,m}, {n}, or {n,} in interval expressions, Searching with More Complex Patterns
- NetBSD, Problem
- (see also BSD-based systems)
- compiling and linking tty loadable builtin, Discussion
- stable sort, Discussion
- Netcat, Solution
- network redirection features
- using bash net-redirections, Problem
- using in Logger, Netcat, or bash, Solution
- Network Time Protocol (NTP), Working with Dates and Times
- newlines
- next command, Discussion
- nl command, Solution, Discussion
- No such file or directory errors, Problem
- noclobber option, Discussion
- nohup command, Solution, Discussion
- NTP (Network Time Protocol), Working with Dates and Times
- nullglob option, Discussion
- nullmailer, Discussion
- numbered variables, Solution
- numbers
O
- -o (logical OR) operator, Solution
- od (octal dump) command, Discussion
- ODF (OpenDocument Format), Solution
- .odt file extension, Solution
- OpenBSD, Writing Secure Shell Scripts, Discussion, Discussion
- (see also BSD-based systems)
- getting bash for, Solution
- OpenPKG project, Discussion
- OpenSSH, Problem, Discussion
- operating systems
- operators
- options
- output, Standard Output-Discussion
- adding a prefix or suffix to, Problem
- appending rather than clobbering, Problem
- connecting program to output file, Standard Output
- connecting two programs using output as input, Problem
- cutting out parts of, Problem
- displaying/using beginning or end of a file, Problem
- from functions, Solution
- keeping files safe from accidental overwriting, Problem
- keeping only a portion of line of output, Problem
- keeping some and discarding the rest, Problem
- preserving spacing in, Problem
- redirecting for the life of a script, Problem
- redirecting to a file, Problem
- redirecting to file with ls command, Problem
- redirecting to files other than in current directory, Problem
- redirecting to several different places, Problem
- saving or grouping from several commands, Problem
- saving output used as input, Problem
- saving when redirect doesn't work, Problem
- sending output and error messages to different files, Problem
- sending output and error messages to same file, Problem
- skipping the header in a file, Problem
- sorting, Problem
- splitting only when necessary, Problem
- swapping STDERR and STDOUT before pipe redirection, Problem
- throwing away, Problem
- using as arguments to connect two programs, Problem
- viewing in hex mode, Problem
- writing to the terminal/window, Problem
- writing with more formatting control, Problem
- writing without newlines, Problem
P
- -p (prompt) option, read statement, Discussion
- -P option, pwd and cd, Discussion
- package systems, using to update bash and your system, Solution
- paragraphs
- rewrapping lines in, using fmt, Problem
- showing paragraph of text after found phrase, Solution
- parameter expansion, Discussion
- ${!prefix*} syntax, Discussion
- ${!prefix@} syntax, Discussion
- ${#VAR}, Discussion
- ${1:0:1} syntax, substring of a shell variable, Discussion, Problem
- ${:+} syntax, Solution
- ${:-} syntax, Solution
- ${:?} syntax, Solution
- ${VAR#alt}, Discussion
- removing text that matches a pattern, Solution
- parameters
- for bash functions, Solution
- handling lists of parameters with spaces, Problem
- handling parameters with spaces, Problem
- unset, giving error message for, Problem
- using command-line parameters in shell scripts, Solution
- parsing, Parsing and Similar Tasks-Discussion
- compressing whitespace, Problem
- converting datafile to CSV, Problem
- extracting fields in a datafile and updating them, Problem
- isolating specific fields in data, Problem
- of arguments for shell scripts, Discussion
- of CSV datafile, Problem
- of output into an array, Problem
- of output using a function call, Problem
- processing fixed-length records, Problem
- taking strings apart one character at a time, Problem
- trimming whitespace from lines for fields of data, Problem
- using bash to parse HTML, Problem
- using getopts command to parse shell script arguments, Problem
- writing your own error messages, Problem
- using read -a to parse words into an array, Problem
- using read statement to parse text, Problem
- using to make words plural, Problem
- passwd -e command, Solution
- passwd -l command, Solution
- passwords
- patch command, Solution
- patches
- PATH environment variable, Discussion
- $PATH shell variable, Discussion
- adding current directory to, Problem
- adding ~/bin to, Solution
- changing permanently, Solution
- changing temporarily, Problem
- current directory not in, Problem
- finding files on or not on $PATH, Problem
- finding out how $PATH is set, Discussion
- finding world-writable directories in, Problem
- security risk with putting . (dot) in, Discussion
- setting a POSIX $PATH, Problem
- setting secure $PATH, Problem
- pathname expansion, Discussion
- pathnames, finishing with Tab key, Problem
- paths, Solution
- pattern matching, Discussion, Searching with More Complex Patterns
- (see also regular expressions)
- characters in bash, Pattern-Matching Characters
- forgetting that it alphabetizes, Problem
- in case statement, Discussion, Discussion, Discussion
- leading and trailing spaces, Solution
- mechanisms performed by, Discussion
- reducing typos in, Problem
- regular expressions and, Discussion
- testing strings with, Problem-Problem
- using to validate input, Solution
- pause command (DOS), emulating, Problem
- PC emulator, Discussion
- Perl, Discussion
- converting a datafile to CSV, Solution
- converting epoch seconds to dates and time, Discussion
- date and time modules, Discussion
- dates and time, converting to epoch seconds, Discussion
- getting yesterday and tomorrow's dates, Problem
- hexdump script, Discussion
- matching IP addresses with regular expressions, Discussion
- using to add prefix or suffix to last command output, Discussion
- using to commify numbers, Discussion
- using to number lines in a file, Discussion
- using to parse a CSV datafile, Solution
- using to parse ifconfig output for IP address, Discussion
- using to process fixed-length records, Solution
- Perl Compatible Regular Expressions (PCRE), Discussion
- permissions, setting, Problem
- pgrep utility, Solution
- phases, using to automate a process, Problem
- usage or summary routine listing phases, Discussion
- photo album, generating, Problem
- PID (see process ID)
- pipelines, Discussion, Command-Line Processing Steps
- forgetting that they make subshells, Problem
- hooking up sort to any program's standard output, Discussion
- search for text in, using grep, Problem
- pluralizing words, Problem
- POD (Plain Old Documentation), Discussion
- Polarhome, Solution
- popd command, Solution
- portable scripts, Advanced Scripting
- (see also scripting, advanced)
- developing, Problem
- using echo portably, Problem
- using for loops portably, Problem
- using virtual machines for testing, Solution
- positional parameters, Discussion
- --posix option, Discussion
- POSIX standard, Why bash?
- POSIX syntax
- postfix style notation, Discussion
- PowerShell (Windows), Solution
- predicates, Discussion
- print predicate for find utility, Discussion
- print statement in awk, Discussion
- printf binary executable, Discussion
- printf command, Problem, Discussion, Discussion, Discussion, Discussion
- best practices for, Discussion
- error message for case statement parsing arguments, Discussion
- following read -s command, Discussion
- function for printf statement, Discussion
- newer format supporting date and time values, Discussion
- printf "%b", Solution
- printf '%(fmt)T for dates and times, bash 4 or newer, Solution
- printf binary executable versus, Discussion
- reference on, printf-Examples
- seeing odd behavior from, Problem
- strftime format for today, Discussion
- using in awk for loop, Discussion
- using in GNU find to capture file metadata, Solution
- using with awk to show histogram of some data, Discussion
- writing output without newline, Solution
- private key, Solution
- privilege escalation, Discussion
- process ID (PID), Discussion
- processes
- coprocesses and coproc command, Solution
- finding out if a process is running, Problem
- profiles
- programmable completion, improving, Problem
- prompts
- bash printing prompt before reading input, Discussion
- changing for select menus, Problem
- customizing bash prompt, Problem, Prompt String Customizations
- decoding, Problem
- default interactive prompt $PS1 and $PROMPT_COMMAND, Discussion
- directory location, Problem
- setting $PS1 at inappropriate times, Discussion
- setting $PS4 prompt, Solution
- using secondary prompts, $PS2, $PS3, and $PS4, Problem
- promptvars shell option, Discussion
- $PROMPT_COMMAND, Discussion, Discussion
- $PROMPT_DIRTRIM, Discussion
- ps command, Problem
- grepping output to find if program is running, Solution
- grepping ps output without getting the grep process, Problem
- many variations in, Discussion
- ps auwx | grep [s]creen, Solution
- pseudosignals, Discussion
- pseudoterminal (PTY), Basic prompts
- public key, Solution
- pushd command, Solution
- pwd (print working directory) built-in command, Solution
Q
- quotation marks
- forgetting on assignments, causing command not found, Problem
- in alias definitions, Discussion
- in filenames containing special characters, Solution
- in prompts, Discussion
- quoting in command-line processing, Quoting
- quoting issues on ssh command, Discussion
- using for strings in printf, Discussion
- using shell quoting, Problem
- using to preserve spacing in output, Problem
- using with file arguments, Discussion
R
- race conditions, Discussion, Discussion, Discussion
- avoiding between creating a directory and setting permissions, Solution
- Ramey, Chet, Beginning bash
- random numbers (see $RANDOM variable, under Symbols)
- random temporary directories and filenames, Solution
- ranges
- character range, specifying with tr command, Solution
- day ranges for each week of a month, Discussion
- rbash (restricted bash), Discussion
- rc files, Problem
- (see also initialization files)
- portable and self-contained, creating, Problem
- read statement, Solution, Discussion
- readability (scripts), best practices for, Problem
- readarray command, Solution
- readline
- Red Hat Linux distributions, Discussion, Discussion
- Red Hat Package Manager (RPM) files, Discussion
- redirections, Standard Output
- regular expressions, Problem
- confusing with shell wildcards, Problem
- interval expressions in, Searching with More Complex Patterns
- matching a Social Security number, Problem
- matching IP addresses, Discussion
- using for searches, Discussion
- using to grep ps outout without getting grep process, Solution
- using to match filenames with find command, Discussion
- using to validate input, Solution
- using with awk, Discussion
- using with grep, Discussion
- relative paths, Discussion
- remainder operator (%), Discussion
- rename, many uses of the name, Discussion
- reserved words, Solution
- reset command, Discussion
- restricted shell, Discussion
- RETURN signal, Discussion
- return values
- reverse numerical sort (sort -rn), Discussion
- revision control systems, Problem, Revision Control-Accessing These Features
- rm command, Problem, Discussion
- Robbins, Daniel, Solution
- root access
- root user, Solution
- ROT13 substitution cypher, Discussion, Discussion
- ROT47 substitution cypher, Discussion
- rpm2cpio script, Discussion
- RPN calculator, creating, Problem
- rssh (restricted SSH), Discussion
- rsync program, Solution
- runas alias, Solution
S
- -s (silent) option, read command, Discussion
- scp utility, Solution
- screen command, Basic prompts
- script program, using to log an entire session or batch job, Solution
- scripting, advanced, Advanced Scripting-Discussion
- automating processes using phases, Problem
- doing two things at once, Problem
- finding IP address for your machine, Problem
- getting input from another machine, Problem
- logging to syslog from scripts, Problem
- redirecting output for the life of a script, Problem
- running an SSH command on multiple hosts, Problem
- sending email from scripts, Problem-Problem
- setting a POSIX $PATH, Problem
- splitting output only when necessary, Problem
- testing scripts on virtual machines, Problem
- using bash net-redirection, Problem
- using echo portably, Problem
- using for loops portably, Problem
- using logger correctly, Problem
- viewing output in hex mode, Problem
- working around "Argument list too long" errors, Problem
- scripts
- avoiding aliases and functions, Problem
- changing behavior with redirections, Problem
- consuming arguments, Problem
- counting arguments script was invoked with, Problem
- counting elapsed time for script or operation in the script, Problem
- debugging, Problem
- defining functions in, Problem
- documenting, Problem
- embedding documentation in, Problem
- end user tasks as shell scripts, End-User Tasks as Shell Scripts-Discussion
- getting default values for arguments, Problem
- giving error message for unset parameters, Problem
- handling lists of parameters with spaces, Problem
- keeping data with, Problem
- looping over arguments passed to, Problem
- promoting readability in, Problem
- redefining commands with alias, Problem
- reusing code with includes and sourcing, Problem
- running as daemon, Problem
- secure (see secure shell scripts)
- setting default values for variables, Problem
- testing bash script syntax, Problem
- trapping interrupts, Problem
- using external configuration files in, Problem
- using functions, parameters and return values, Problem
- using parameters in, Problem
- writing wrappers for, Problem
- sdiff utility, Solution
- secondary prompt ($PS2), Discussion, Solution
- $SECONDS variable, Solution
- secure locate (see slocate)
- secure shell scripts, Writing Secure Shell Scripts-Discussion
- avoiding common security problems, Problem
- avoiding interpreter spoofing, Problem
- clearing all aliases, Problem
- clearing the command hash, Problem
- disconnecting inactive sessions, Problem
- finding world-writable directories in your $PATH, Solution
- leaking passwords into the process list, Problem
- preventing core dumps, Problem
- restricting guest users, Problem
- restricting SSH commands, Problem
- running as non-root user, Problem
- secure shell programming techniques, Writing Secure Shell Scripts
- setting a secure $IFS, Problem
- setting a secure $PATH, Problem
- setting a secure umask, Problem
- setting permissions, Problem
- using chroot jails, Problem
- using passwords in scripts, Problem
- using secure temporary files, Problem
- using SSH without a password, Problem
- using sudo more securely, Problem
- validating external input, Problem
- writing setuid or setgid scripts, Problem
- security
- security by obscurity, Writing Secure Shell Scripts
- Security Enhanced Linux (SELinux), Discussion
- security policies, Discussion
- sed utility, Intermediate Shell Tools I, Solution
- adding newlines to files without line breaks, Discussion
- editing a file in place, Discussion
- newline in substitution string, Discussion
- prepending data to existing file, Solution-Discussion
- translating characters with, Discussion
- using in parsing HTML, Discussion
- using regular expressions with, Discussion
- using to add prefix or suffix to last command output, Discussion
- using to commify numbers, Solution
- using to parse a CSV datafile, Solution
- using to update fields in a datafile, Solution
- select prompt ($PS3), Discussion, Solution
- select statement, Solution
- seq command, Solution, Discussion, Discussion
- sequences, writing, Problem
- sessions
- recovering disconnected sessions with screen, Problem
- sharing a single bash session, Problem
- set command, Solution, Discussion
- options, reference listing of, set Options
- piping into grep, Discussion
- set +o noclobber, Solution
- set -e, Discussion
- set -o functrace, Discussion
- set -o noclobber, Solution
- set -o posix, Discussion
- set -u, Discussion
- set -x, Solution
- setuid and setgid, Problem
- setuid root spoofing attacks, Problem
- shared objects, compiling and linking, Discussion
- shebang (#!), lines beginning with, Solution, Discussion
- shell parameter expansion (see parameter expansion)
- shell scripting, The bash Shell
- (see also scripting, advanced; scripts; secure shell scripts)
- shell scripts, Beginning bash
- (see also scripting, advanced; scripts; secure shell scripts)
- running commands in, Solution
- to run on startup, Solution
- shell variables (see variables)
- shells
- shellshock vulnerability, Discussion
- shift statement, using to remove arguments after handling them, Solution, Discussion, Discussion, Discussion, Solution
- shopt command, Discussion
- short circuits, Discussion
- SIGHUP signal, Discussion
- SIGKILL signals, Discussion
- signals
- providing for kill command textual completion, Discussion
- script trapping and responding to, Problem
- SIGTERM signal, Discussion
- -size predicate (find), Solution
- slocate, Discussion, Solution
- Social Security number, searching for, using regular expressions, Problem
- Solaris, Discussion, Solution
- sort command, Discussion
- ignoring case with -f or --ignore-case option, Discussion
- removing duplicates with -u option, Solution
- reversing sort order with -r option, Discussion
- sorting IP addresses, Problem
- sorting numbers
- sorting output, Solution
- using with awk to show histogram of some data, Discussion
- sorting, Intermediate Shell Tools II
- sort order comparison of Linux, NetBSD, and Solaris, Discussion
- source code (bash), Official documentation
- source command, Solution, Solution
- sourcepath option, Solution
- [:space:] character class, Discussion
- split command, Problem
- spreadsheets, loading CSV datafile into, Solution
- SSH, Solution
- ssh command, quoting issues on, Discussion
- ssh-add command, Solution
- ssh-agent, Solution
- ssh-keygen, Solution
- SSH2, Problem
- SSH_ID, Discussion
- SSH_USER, Discussion
- SSMTP package, Discussion
- stable sort, Discussion
- stacks, Discussion
- standard error (STDERR), Discussion, Discussion
- standard input (STDIN), Discussion, Discussion
- standard output (STDOUT), Discussion, Discussion
- (see also output)
- buffering of, Discussion
- sending function output to, using echo and printf, Solution
- swapping STDERR and STDOUT before pipe redirection, Problem
- start and end timestamps for commands run, in the prompt, Solution
- startup options for bash, Problem
- stat command, Problem
- strftime format, Solution, Discussion
- strings
- stty -echo, problems caused by, Discussion
- stty sane command, Solution
- su command, sudo versus, Discussion
- subshells, Discussion
- substitution cypher for text, Discussion
- substitutions
- quick substitutions with ^ (caret) mechanism, Problem
- using !! (history) operator, Solution
- Subversion, Problem, Subversion-Meld
- cleaning up SVN source tree, Problem
- sudo utility, Solution
- sudoers utility, Solution
- summing a list of numbers, Problem
- SUSE Linux, Discussion
- svn -v log | less command, Discussion
- svn status command, Problem
- switch statement, bash case statement and, Discussion
- symbolic links
- syslog, logging to, from scripts, Discussion, Problem
- system recovery, using chroot during, Discussion
T
- -t (timeout) option, read statement, Discussion
- tabs
- tail command, Solution
- tar (tape archive) command, Solution
- tarballs, Solution
- tee command, Solution, Discussion
- temporary files
- terminals
- test command, Discussion, Solution
- test operators, Test Operators
- test, mistakenly naming script as, Problem
- Texinfo, using on Linux, Problem
- text
- search for, in a pipeline, Problem
- searching for, ignoring case, Problem
- showing paragraph of text after found phrase, Problem
- translating characters in, Problem
- then clause, Discussion
- tilde expansion, Discussion
- time command, Solution
- time zones, Discussion, Discussion
- timestamps, Discussion
- start and end for command run, displaying in the prompt, Solution
- tips on avoiding common goofs, Tips and Traps: Common Goofs for Novices-Discussion
- confusing shell wildcards and regular expressions, Problem
- debugging scripts, Problem
- deleting files with an empty variable, Problem
- expecting to change exported variables, Problem
- forgetting quotes on assignments, causing command not found, Problem
- forgetting that current directory is not in the $PATH, Problem
- forgetting that pattern matching alphabetizes, Problem
- forgetting that pipelines make subshells, Problem
- forgetting to set execute permissions, Problem
- making your terminal sane again, Problem
- naming your script test, Problem
- No such file or directory errors, Problem
- seeing odd behavior from printf, Problem
- testing bash script syntax, Problem
- using functions, command not found, Problem
- $TMOUT environment variable, Solution
- tr (translate) command, Intermediate Shell Tools II, Solution
- trace output, $PS4 prompt, Solution
- trap utility
- traps
- setting trap to run clear on shell termination, Solution
- setting traps using clear, Discussion
- Trojaned utilities, Discussion
- true/false, getting from a search, Problem
- tset command, Discussion
- tty loadable builtin, Discussion
- common systems and commands to compile and link, Discussion
- 24-hour time, Discussion
- type command, Discussion, Solution, Discussion
- -type predicate (find), Solution
- typescript, Solution
- typing less (see working faster, typing less)
U
- Ubuntu
- Ubuntu on Windows, Solution
- Ubuntu Personal Package Archive (PPA), Solution
- ulimit command, Solution
- umask command, setting secure $UMASK, Problem
- unalias -a command, Solution
- unalias command, Discussion
- uncompressing files, Problem
- uniq command, Solution
- Unix
- unset DB command, Discussion
- unzip utility, Solution, Discussion
- updates for bash and your system, Problem
- uppercase characters (see case)
- urandom utility, Discussion
- user alias, Solution
- usermod -s command, Solution
- /usr/bin/env command, Solution
- utilities
- uuencode, Solution, Discussion
V
- validation of external input, Discussion
- variables, Basic Scripting: Shell Variables-Discussion
- $ (dollar sign) indicating variable references, Basic Scripting: Shell Variables
- assignments, Basic Scripting: Shell Variables
- awk, Discussion
- builtin shell variables, Builtin Shell Variables
- caution with names, Discussion
- changing part of string values, Problem
- comma-separated values (CSV) list, Problem
- converting between upper- and lowercase names, Problem
- converting strings to camel case, Problem
- declaring to be lower- or uppercase, Solution
- exporting, Problem
- functions returning values by setting variables, Discussion
- getting default values, Problem
- in printf statements, best practices for, Discussion
- null as valid default value, Problem
- numeric values, getting absolute value for, Problem
- running commands from a variable, Problem
- seeing all variable values, Problem
- separating variable names from surrounding text, Problem
- setting default values, Problem
- shell expansion and substitution, Discussion
- using array variables, Problem
- using bash for basename, Problem
- using bash string manipulation for basename, Problem
- using bash string manipulation for dirname, Problem
- using meaningful names for, Discussion
- using more than a constant string as default value, Problem
- vi editor, Solution, Discussion, Discussion
- vipw command, Solution
- virtual machines
- VirtualBox, Discussion
- visudo program, Discussion
- Vixie-cron, Solution
W
- wc (word count) command, Solution, Discussion
- wdiff utility, Discussion
- wget utility, Solution
- which command, Discussion, Solution
- different behaviors on different systems, Discussion
- while loops
- whitespace
- wildcards
- confusing shell wildcards and regular expressions, Problem
- file, Solution
- working around wildcard expansion in unzip utility, Discussion
- Windows
- windows (see terminals)
- word processors, Solution, Other
- words, counting (see wc command)
- working faster, typing less, Working Faster by Typing Less-Discussion
- dealing with big changes and more lines, Problem
- finishing names for you, Problem
- moving quickly among arbitrary directories, Problem
- quick substitutions in previously executed command, Problem
- reducing occurrence of typos, Problem
- repeating the last command, Problem
- reusing arguments, Problem
- running almost the same command, Problem
- world-writable directories, finding in $PATH, Problem
- wrappers, writing for shell scripts, Problem
..................Content has been hidden....................
You can't read the all page of ebook, please click
here login for view all page.