bind (built-in Bash command)

Content

 

Data

License: GNU GPLv3 +
Version number: GNU Bash 5
Developer / owner: Free Software Foundation Inc.

Short description:

The manual page and help for the bind built-in Bash command. The bind command is a command for setting readline keybindings and variables. Assign a keystroke to a Readline function or macro, or set a Readline variable.

 

 

Man page output

man bash
[...]
       bind [-m keymap] [-lpsvPSVX]
       bind [-m keymap] [-q function] [-u function] [-r keyseq]
       bind [-m keymap] -f filename
       bind [-m keymap] -x keyseq:shell-command
       bind [-m keymap] keyseq:function-name
       bind [-m keymap] keyseq:readline-command
              Display  current readline key and function bindings, bind a key sequence to a read-
              line function or macro, or set a readline variable.  Each non-option argument is  a
              command  as it would appear in .inputrc, but each binding or command must be passed
              as a separate argument; e.g., '"\C-x\C-r": re-read-init-file'.   Options,  if  sup-
              plied, have the following meanings:
              -m keymap
                     Use keymap as the keymap to be affected by the subsequent bindings.  Accept-
                     able keymap names are emacs,  emacs-standard,  emacs-meta,  emacs-ctlx,  vi,
                     vi-move, vi-command, and vi-insert.  vi is equivalent to vi-command (vi-move
                     is also a synonym); emacs is equivalent to emacs-standard.
              -l     List the names of all readline functions.
              -p     Display readline function names and bindings in such a way that they can  be
                     re-read.
              -P     List current readline function names and bindings.
              -s     Display  readline  key sequences bound to macros and the strings they output
                     in such a way that they can be re-read.
              -S     Display readline key sequences bound to macros and the strings they output.
              -v     Display readline variable names and values in such a way that  they  can  be
                     re-read.
              -V     List current readline variable names and values.
              -f filename
                     Read key bindings from filename.
              -q function
                     Query about which keys invoke the named function.
              -u function
                     Unbind all keys bound to the named function.
              -r keyseq
                     Remove any current binding for keyseq.
              -x keyseq:shell-command
                     Cause  shell-command  to  be  executed  whenever  keyseq  is  entered.  When
                     shell-command is executed, the shell sets the READLINE_LINE variable to  the
                     contents  of the readline line buffer and the READLINE_POINT variable to the
                     current location of the insertion point.  If the  executed  command  changes
                     the  value  of READLINE_LINE or READLINE_POINT, those new values will be re-
                     flected in the editing state.
              -X     List all key sequences bound to shell commands and the  associated  commands
                     in a format that can be reused as input.

              The return value is 0 unless an unrecognized option is given or an error occurred.
[...]

 

 

Help output

bind --help
bind: bind [-lpsvPSVX] [-m kiosztás] [-f fájlnév] [-q név] [-u név] [-r billkomb] [-x billkomb:shell
-parancs] [billkomb:readline-függvény vagy readline-parancs]
    Readline billentyűkötések és változók beállítása.

    Egy billentyűsorozat hozzárendelése Readline függvényhez vagy makróhoz,
    vagy Readline változó beállítása. A beállítás nélküli szintaxis megegyezik
    az ~/.inputrc-ben találhatóval, de kell legyen egy argumentuma:
    pl. bind '"\C-x\C-r": re-read-init-file'.

    Kapcsolók:
      -m  kiosztás       A KIOSZTÁS használata kiosztásként a parancs hatásának
                         idejére. Elfogadható kiosztásnevek: emacs,
                         emacs-standard, emacs-meta, emacs-ctlx, vi, vi-
                         move, vi-command és vi-insert.
      -l                 Nevek és függvények listázása.
      -P                 Függvénynevek és kötések listázása.
      -p                 Függvények és kötések listázása újrahasználható
                         formában.
      -S                 Makrókat végrehajtó billentyűkombinációk és értékeik
                         listázása.
      -s                 Makrókat végrehajtó billentyűkombinációk és értékeik
                         listázása újrahasználható formában.
      -V                 Változónevek és értékek listázása.
      -v                 Változónevek és értékek listázása újrahasználható
                         formában.
      -q  függvénynév    A függvényhez tartozó billentyűkombináció lekérése.
      -u  függvénynév    Össze adott függvényhez tartozó billentyűkombináció
                         törlése.
      -r  billkomb       A BILLKOMB-hoz tartozó kötések törlése.
      -f  fájlnév        Kötések olvasása FÁJLNÉV fájlból.
      -x  billkomb:shell-parancs        SHELL-PARANCS végrehajtása BILLKOMB-ra.
      -X                 A -x használatával kötött billentyűkombinációk
                         és a társított parancsok kiírása, bemenetként
                         újrahasználható formában.

    Kilépési kód:
    a bind 0-val tér vissza, ha nincs ismeretlen kapcsoló vagy hiba.

 

Related Content