Licenc: GPLv3+: a GNU GPL 3. vagy újabb változata
Verziószám: 4.4 (Debian 9-ben)
Fejlesztő/tulajdonos: Free Software Foundation, Inc.

Rövid leírás: Az shopt parancs segítségével a Bash működését befolyásolhatjuk a különböző opciók állítgatásával...

Az alábbi shopt manual a Bash manual oldalából került kiemelésre.



Man oldal kimenet

man bash
BASH(1)                       General Commands Manual                      BASH(1)

       bash - GNU Bourne-Again SHell

       bash [options] [command_string | file]

       Bash is Copyright (C) 1989-2016 by the Free Software Foundation, Inc.

       Bash  is  an  sh-compatible command language interpreter that executes com‐
       mands read from the standard input or from a file.  Bash also  incorporates
       useful features from the Korn and C shells (ksh and csh).

       Bash  is intended to be a conformant implementation of the Shell and Utili‐
       ties portion of the IEEE POSIX specification (IEEE Standard 1003.1).   Bash
       can be configured to be POSIX-conformant by default.


       Unless otherwise noted, each builtin command documented in this section  as
       accepting  options  preceded  by  -  accepts  --  to signify the end of the
       options.  The :, true, false, and test builtins do not accept  options  and
       do not treat -- specially.  The exit, logout, return, break, continue, let,
       and shift builtins accept and process arguments beginning  with  -  without
       requiring  --.   Other builtins that accept arguments but are not specified
       as accepting options  interpret  arguments  beginning  with  -  as  invalid
       options and require -- to prevent this interpretation.


       shopt [-pqsu] [-o] [optname ...]
              Toggle the values of settings controlling optional  shell  behavior.
              The  settings can be either those listed below, or, if the -o option
              is used, those available with the -o option to the set builtin  com‐
              mand.   With  no  options, or with the -p option, a list of all set‐
              table options is displayed, with an indication  of  whether  or  not
              each  is set.  The -p option causes output to be displayed in a form
              that may be reused as input.  Other options have the following mean‐
              -s     Enable (set) each optname.
              -u     Disable (unset) each optname.
              -q     Suppresses  normal  output  (quiet  mode);  the return status
                     indicates whether the optname is set or unset.   If  multiple
                     optname  arguments  are  given  with -q, the return status is
                     zero if all optnames are enabled; non-zero otherwise.
              -o     Restricts the values of optname to be those defined  for  the
                     -o option to the set builtin.

              If  either  -s  or -u is used with no optname arguments, shopt shows
              only those options which are set  or  unset,  respectively.   Unless
              otherwise noted, the shopt options are disabled (unset) by default.

              The  return  status when listing options is zero if all optnames are
              enabled, non-zero otherwise.  When setting or unsetting options, the
              return status is zero unless an optname is not a valid shell option.

              The list of shopt options is:

              autocd  If  set,  a  command name that is the name of a directory is
                      executed as if it were the argument to the cd command.  This
                      option is only used by interactive shells.
                      If  set, an argument to the cd builtin command that is not a
                      directory is assumed to be the  name  of  a  variable  whose
                      value is the directory to change to.
              cdspell If  set,  minor errors in the spelling of a directory compo‐
                      nent in a cd command will be corrected.  The errors  checked
                      for  are transposed characters, a missing character, and one
                      character too many.  If a correction is found, the corrected
                      filename  is printed, and the command proceeds.  This option
                      is only used by interactive shells.
                      If set, bash checks that a command found in the  hash  table
                      exists  before trying to execute it.  If a hashed command no
                      longer exists, a normal path search is performed.
                      If set, bash lists the status of  any  stopped  and  running
                      jobs  before  exiting an interactive shell.  If any jobs are
                      running, this causes the exit to be deferred until a  second
                      exit  is  attempted  without an intervening command (see JOB
                      CONTROL above).  The shell always postpones exiting  if  any
                      jobs are stopped.
                      If  set, bash checks the window size after each command and,
                      if necessary, updates the values of LINES and COLUMNS.
              cmdhist If set, bash attempts to save all lines of  a  multiple-line
                      command  in  the  same  history entry.  This allows easy re-
                      editing of multi-line commands.
                      If set, bash changes its behavior to  that  of  version  3.1
                      with  respect to quoted arguments to the [[ conditional com‐
                      mand's =~ operator  and  locale-specific  string  comparison
                      when  using  the [[ conditional command's < and > operators.
                      Bash versions prior to bash-4.1 use ASCII collation and str‐
                      cmp(3);  bash-4.1  and later use the current locale's colla‐
                      tion sequence and strcoll(3).
                      If set, bash changes its behavior to  that  of  version  3.2
                      with respect to locale-specific string comparison when using
                      the [[ conditional command's < and > operators (see previous
                      item)  and  the effect of interrupting a command list.  Bash
                      versions 3.2 and earlier continue with the next  command  in
                      the list after one terminates due to an interrupt.
                      If  set,  bash  changes  its behavior to that of version 4.0
                      with respect to locale-specific string comparison when using
                      the [[ conditional command's < and > operators (see descrip‐
                      tion of compat31) and the effect of interrupting  a  command
                      list.   Bash versions 4.0 and later interrupt the list as if
                      the shell received the interrupt; previous versions continue
                      with the next command in the list.
                      If set, bash, when in posix mode, treats a single quote in a
                      double-quoted parameter expansion as  a  special  character.
                      The  single quotes must match (an even number) and the char‐
                      acters between the  single  quotes  are  considered  quoted.
                      This is the behavior of posix mode through version 4.1.  The
                      default bash behavior remains as in previous versions.
                      If set, bash does not process the replacement string in  the
                      pattern substitution word expansion using quote removal.
                      If  set, bash does not print a warning message if an attempt
                      is made to use a quoted  compound  array  assignment  as  an
                      argument  to  declare, makes word expansion errors non-fatal
                      errors that cause the current command to fail  (the  default
                      behavior  is  to make them fatal errors that cause the shell
                      to exit), and does not reset the loop  state  when  a  shell
                      function  is  executed  (this  allows break or continue in a
                      shell function to affect loops in the caller's context).
                      If set, bash quotes all shell  metacharacters  in  filenames
                      and directory names when performing completion.  If not set,
                      bash removes metacharacters such as the dollar sign from the
                      set of characters that will be quoted in completed filenames
                      when these metacharacters appear in  shell  variable  refer‐
                      ences  in  words  to  be  completed.  This means that dollar
                      signs in variable names that expand to directories will  not
                      be  quoted; however, any dollar signs appearing in filenames
                      will not be quoted, either.  This is active only  when  bash
                      is  using  backslashes  to  quote completed filenames.  This
                      variable is set by default, which is the default bash behav‐
                      ior in versions through 4.2.
                      If  set,  bash  replaces directory names with the results of
                      word expansion when performing  filename  completion.   This
                      changes the contents of the readline editing buffer.  If not
                      set, bash attempts to preserve what the user typed.
                      If set, bash attempts spelling correction on directory names
                      during  word completion if the directory name initially sup‐
                      plied does not exist.
              dotglob If set, bash includes filenames beginning with a `.' in  the
                      results of pathname expansion.
                      If  set,  a non-interactive shell will not exit if it cannot
                      execute the file  specified  as  an  argument  to  the  exec
                      builtin command.  An interactive shell does not exit if exec
                      If set,  aliases  are  expanded  as  described  above  under
                      ALIASES.   This option is enabled by default for interactive
                      If set at shell invocation, arrange to execute the  debugger
                      profile before the shell starts, identical to the --debugger
                      option.  If set after invocation, behavior intended for  use
                      by debuggers is enabled:
                      1.     The  -F  option  to  the declare builtin displays the
                             source file name and  line  number  corresponding  to
                             each function name supplied as an argument.
                      2.     If  the  command run by the DEBUG trap returns a non-
                             zero value, the next command is skipped and not  exe‐
                      3.     If  the command run by the DEBUG trap returns a value
                             of 2, and the shell is executing in a  subroutine  (a
                             shell function or a shell script executed by the . or
                             source builtins),  the  shell  simulates  a  call  to
                      4.     BASH_ARGC  and  BASH_ARGV are updated as described in
                             their descriptions above.
                      5.     Function tracing is  enabled:  command  substitution,
                             shell functions, and subshells invoked with ( command
                             ) inherit the DEBUG and RETURN traps.
                      6.     Error tracing is enabled: command substitution, shell
                             functions,  and  subshells  invoked  with ( command )
                             inherit the ERR trap.
              extglob If set, the extended  pattern  matching  features  described
                      above under Pathname Expansion are enabled.
                      If  set, $'string' and $"string" quoting is performed within
                      ${parameter} expansions enclosed  in  double  quotes.   This
                      option is enabled by default.
                      If  set, patterns which fail to match filenames during path‐
                      name expansion result in an expansion error.
                      If set, the suffixes specified by the FIGNORE shell variable
                      cause  words  to  be ignored when performing word completion
                      even if the ignored words are the only possible completions.
                      See  SHELL  VARIABLES  above  for  a description of FIGNORE.
                      This option is enabled by default.
                      If set, range expressions used in pattern  matching  bracket
                      expressions (see Pattern Matching above) behave as if in the
                      traditional C locale when performing comparisons.  That  is,
                      the  current  locale's  collating sequence is not taken into
                      account, so b will not collate between A and B,  and  upper-
                      case and lower-case ASCII characters will collate together.
                      If  set, the pattern ** used in a pathname expansion context
                      will match all files and zero or more directories and subdi‐
                      rectories.  If the pattern is followed by a /, only directo‐
                      ries and subdirectories match.
                      If set, shell error messages are written in the standard GNU
                      error message format.
                      If  set,  the  history list is appended to the file named by
                      the value of the HISTFILE variable  when  the  shell  exits,
                      rather than overwriting the file.
                      If  set,  and  readline  is  being used, a user is given the
                      opportunity to re-edit a failed history substitution.
                      If set, and readline is being used, the results  of  history
                      substitution are not immediately passed to the shell parser.
                      Instead, the resulting line  is  loaded  into  the  readline
                      editing buffer, allowing further modification.
                      If  set,  and  readline  is being used, bash will attempt to
                      perform hostname completion when a word containing  a  @  is
                      being completed (see Completing under READLINE above).  This
                      is enabled by default.
                      If set, bash will send SIGHUP to all jobs when  an  interac‐
                      tive login shell exits.
                      If  set,  command  substitution  inherits  the  value of the
                      errexit option, instead of  unsetting  it  in  the  subshell
                      environment.   This  option  is  enabled  when posix mode is
                      If set, allow a word beginning with # to cause that word and
                      all  remaining  characters  on that line to be ignored in an
                      interactive shell (see  COMMENTS  above).   This  option  is
                      enabled by default.
                      If  set,  and  job control is not active, the shell runs the
                      last command of a pipeline not executed in the background in
                      the current shell environment.
              lithist If  set,  and the cmdhist option is enabled, multi-line com‐
                      mands are saved to the history with embedded newlines rather
                      than using semicolon separators where possible.
                      The shell sets this option if it is started as a login shell
                      (see INVOCATION above).  The value may not be changed.
                      If set, and a file that bash is checking for mail  has  been
                      accessed  since  the  last  time it was checked, the message
                      ``The mail in mailfile has been read'' is displayed.
                      If set, and readline is being used, bash will not attempt to
                      search  the PATH for possible completions when completion is
                      attempted on an empty line.
                      If set, bash matches filenames in a case-insensitive fashion
                      when  performing  pathname expansion (see Pathname Expansion
                      If set, bash matches patterns in a case-insensitive  fashion
                      when  performing  matching while executing case or [[ condi‐
                      tional commands, when performing pattern  substitution  word
                      expansions,  or  when filtering possible completions as part
                      of programmable completion.
                      If set, bash allows patterns which match no files (see Path‐
                      name  Expansion  above)  to  expand to a null string, rather
                      than themselves.
                      If set, the programmable completion facilities (see Program‐
                      mable Completion above) are enabled.  This option is enabled
                      by default.
                      If set, prompt strings undergo parameter expansion,  command
                      substitution,  arithmetic expansion, and quote removal after
                      being expanded as described in PROMPTING above.  This option
                      is enabled by default.
                      The  shell  sets  this option if it is started in restricted
                      mode (see RESTRICTED SHELL below).  The  value  may  not  be
                      changed.   This is not reset when the startup files are exe‐
                      cuted, allowing the startup files to discover whether or not
                      a shell is restricted.
                      If  set,  the shift builtin prints an error message when the
                      shift count exceeds the number of positional parameters.
                      If set, the source (.) builtin uses the  value  of  PATH  to
                      find  the directory containing the file supplied as an argu‐
                      ment.  This option is enabled by default.
                      If set, the echo builtin expands backslash-escape  sequences
                      by default.


GNU Bash 4.4                      2016 August 26                           BASH(1)



Súgó kimenet

shopt --help
shopt: shopt [-pqsu] [-o] [optnév ...]
    Parancsételmező-kapcsolók beállítása és törlése.
    Minden megadott OPTNÉV kapcsoló beállítása. Argumentumok nélkül hívva
    egy teljes lista kiírása a parancsértelmező kapcsolóiról, jelezve azok
      -o        OPTNEVEK korlátozása a „set -o”-val használtakra
      -p        minden kapcsoló kilistázása az állapotuk jelzésével
      -q        kimenet elnyelése
      -s        minden OPTNÉV engedélyezése
      -u        minden OPTNÉV tiltása
    Kilépési kód:
    Sikerrel tér vissza, ha az OPTNÉV engedélyezve van; sikertelenül, ha
    hibás kapcsolókat kap vagy az OPTNÉV tiltva van.


Kapcsolódó tartalom