Differences between revisions 6 and 14 (spanning 8 versions)
Revision 6 as of 2017-10-19 23:30:10
Size: 175
Comment:
Revision 14 as of 2017-10-20 05:15:36
Size: 792
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
<<TableOfContents>> #pragma section-numbers off
##pragma section-numbers 1
Line 3: Line 4:
= BASH =
GNU - __B__ourne-__A__gain __SH__ell

[[/syntax]]
||||<^tablewidth="100%" tablestyle="border-style: hidden; border-left-style: hidden;" rowstyle="border-style: hidden;">~+GNU '''__B__'''ourne-'''__A__'''gain __'''SH'''__ell+~ ||
||<99% style="vertical-align:top;text-align:left;border-style: hidden;"><<Include(/description, "Description", 2)>> <<Include(/invocation, "Invocation", 2, from="^----$")>> <<Include(/statement, "Statements", 2, from="^----$")>> <<Include(/builtin, "Builtin Commands", 2, from="^----$")>> <<Include(/syntax, "Syntax", 2, from="^----$")>> <<Include(/execution, "Execution", 2, from="^----$")>> ||<style="vertical-align:top;text-align:right;border-style: hidden;"><<TableOfContents>> ||
Line 8: Line 7:
<<Include(/invocation, "Invocation", 2, from="^----$")>>
[[bash/description]]
== Readline ==

GNU Bourne-Again SHell

Description

Bash is a POSIX shell (sh(1) compatible) command interpreter. Many useful features have been added with inspiration drawn from the Korn & C shells. New and unique extensions are occasionally added to the shell. There is also support for custom run-time extensions via the enable builtin command. Bash may be compiled to be POSIX compliant by default as specified by the Shell and Utilities portion of the POSIX specification (IEEE Standard 1003.1).

Invocation

0.1. Modes

GNU bash may be started in any combination of various invocation modes. These modes control:

  • The source from which to interpenetrate commands:
    • user's terminal
    • shell script
    • command string
    • file contents
    • standard input
  • POSIX compatibality
  • Login shell mode
  • Security settings
  • Restricted Shell access

/InteractiveShell

0.1.1. Interactive Shell

0.1.2. Login Shell

  • Login Shell

0.1.3. POSIX Mode

0.1.4. Command String

0.1.5. Interactive Shell

0.1.5.1. Command Line

0.1.5.2. Prompting

0.1.5.3. Completion

0.1.5.4. History

0.1.5.5. Job Control

0.1.6. Shell Script

0.1.7. Command File

0.1.8. Command Stream

0.1.9. Restricted Shell



CategoryBashRef

0.2. Options

0.2.1. -c CommandString

-c [options] -- CommandString [ARG0 [ARG...]]

  • commands are read from the first non-option argument (required)
  • $0 is set as the second non-option argument defaulting to "bash"

  • all remaining non-option arguments are assigned to the positional parameters starting at $1

  • [[ $- =~ c ]] will return true

0.2.2. -i

-i [options]

  • force the shell into Interactive Mode

  • [[ $- =~ i ]] will return true

  • [[ ${PS1+set} = 'set' ]] will return true

Include: Nothing found for "^----$"!

0.2.3. -l

pragma section-numbers 1

0.2.4. Invocation Option l


-l | --login

  • act as a Login Shell

  • --login must appear on the command line before the single-character options to be recognized.

0.2.5. -r

-r

0.2.6. -s

-s [options] -- [ARG0 [ARG...]]

0.2.7. -D

-D | --dump-strings

  • A list of all double-quoted strings preceded by $ is printed on the standard output. These are the strings that are subject to language translation when the current locale is not C or POSIX. This implies the -n option; no commands will be executed.

0.2.8. -O ShoptOption | +O ShoptOption

-O ShoptOption | +O ShoptOption

  • shopt_option is one of the shell options accepted by the shopt builtin (see SHELL BUILTIN COMMANDS below).
  • If shopt_option is present, -O sets the value of that option; +O unsets it.
  • If shopt_option is not supplied, the names and values of the shell options accepted by shopt are printed on the standard output.
  • If the invocation option is +O, the output is displayed in a format that may be reused as input.

0.2.9. --debugger

--debugger

  • Arrange for the debugger profile to be executed before the shell starts.
  • Turns on extended debugging mode (see the description of the extdebug option to the shopt builtin below).
  • These options must appear on the command line before the single-character options to be recognized.

0.2.10. --dump-po-strings

--dump-po-strings

  • Equivalent to -D, but the output is in the GNU gettext po (portable object) file format.
  • These options must appear on the command line before the single-character options to be recognized.

0.2.11. --dump-strings

-D | --dump-strings

  • A list of all double-quoted strings preceded by $ is printed on the standard output. These are the strings that are subject to language translation when the current locale is not C or POSIX. This implies the -n option; no commands will be executed.

0.2.12. --help

--help

  • Display a usage message on standard output and exit successfully.
  • These options must appear on the command line before the single-character options to be recognized.

Include: Nothing found for "^----$"!

0.2.13. --init-file

0.2.14. Invocation Option --rcfile


--rcfile FILE | --init-file FILE

  • Execute commands from file instead of the standard personal initialization file ~/.bashrc if the shell is interactive (see INVOCATION below).
  • An argument of --init-file is equivalent to --rcfile.
  • These options must appear on the command line before the single-character options to be recognized.

0.2.15. --rcfile

--rcfile FILE | --init-file FILE

  • Execute commands from file instead of the standard personal initialization file ~/.bashrc if the shell is interactive (see INVOCATION below).
  • An argument of --init-file is equivalent to --rcfile.
  • These options must appear on the command line before the single-character options to be recognized.

0.2.16. --login

-l | --login

  • act as a Login Shell

  • --login must appear on the command line before the single-character options to be recognized.

0.2.17. --noediting

--noediting

  • Do not use the GNU readline library to read command lines when the shell is interactive.
  • These options must appear on the command line before the single-character options to be recognized.

0.2.18. --noprofile

--noprofile

  • Do not read either the system-wide startup file /etc/profile or any of the personal initialization files ~/.bash_profile, ~/.bash_login, or ~/.profile.
  • By default, bash reads these files when it is invoked as a login shell (see INVOCATION below).
  • These options must appear on the command line before the single-character options to be recognized.

0.2.19. --norc

--norc

  • Do not read and execute the personal initialization file ~/.bashrc if the shell is interactive.
  • This option is on by default if the shell is invoked as sh.
  • These options must appear on the command line before the single-character options to be recognized.

0.2.20. --posix

--posix

  • Change the behavior of bash where the default operation differs from the POSIX standard to match the standard (posix mode).
  • See SEE ALSO below for a reference to a document that details how posix mode affects bash's behavior.
  • These options must appear on the command line before the single-character options to be recognized.

0.2.21. --restricted

0.3. Environment

0.4. Files

0.4.1. Bash Binary

0.4.2. /etc/profile

0.4.3. ~/.bash_profile

0.4.4. ~/.bashrc

0.4.5. ~/.profile

0.4.6. ~/.bash_logout

0.4.7. ~/.inputrc

Statements

Also called "Compound Commands".

0.5. while

0.6. for in

0.7. for

0.8. if

0.9. case

0.10. until

0.11. group

0.12. subshell

0.13. Conditional

0.14. Arithmetic

0.15. select

0.16. coprocess

0.17. Function Definition

Builtin Commands

0.18. : (colon)

Syntax

0.19. Alias

0.20. Expansion

0.21. Redirection

0.22. Comment

0.23. List

0.24. Pipeline

0.25. Simple Command

0.26. Metacharacter

0.27. Reserved Words

0.28. Compound Command

0.29. Coprocess

0.30. Function Definition

0.31. Functions

0.32. Arithmetic Evaluation

0.33. Conditional Expressions

Execution

0.34. Environment

0.35. Parameters

0.36. Working Directory

0.37. Functions

0.38. Open Files

0.39. Traps

0.40. umask

0.41. Options

0.42. Alias

0.43. OS process context

0.44. Exit Status

1. Subshell


bash/description

Readline


CategoryBashRef

bash (last edited 2017-10-20 15:44:44 by Robert Robertson)