Shell/Bash在线运行

所属目录
点击了解高性能代码运行API
运行结果
教程手册
代码仓库
极速运行
交互输入
极速运行模式,更高效的运行,点击编辑器上方的运行按钮即刻体验吧。
以下是用户最新保存的代码
# 命令替换 有两种方法: - 方法一:`command` - 方法二:$(command) 总结: - ``和$()两者是等价的,但推荐初学者使用$(),易于掌握;缺点是极少数UNIX可能不支持,但``都是支持的 - $(())主要用来进行整数运算,包括加减乘除,引用变量前面可以加$,也可以不加$ 发布于:2023-03-17 21:48 awk的for循环和二维字典和printf实现二维数据表倒置 发布于:2023-03-15 23:34 # 变量替换 ## 字符串处理 ### 字符长度 1. ${#string} 2. `expr length "$string"` ### 获取字符串索引位置 1. expr index "$string" substr ### 获取子串长度 1. expr match "$string" substr ### 抽取子串 方法一: 1. ${string:position} 2. ${string:position:length} 3. ${string: -position} 或者 ${string:(position)} 方法二: 1. expr substr $string $position $length 注意:使用expr,索引计数是从1开始计算;使用${string:position},索引计数是从0开始计数 发布于:2023-03-17 21:33 for 循环用法 发布于:2023-03-15 03:47 测试测试测试测试测试测试测试 发布于:2023-03-14 10:48 #echo,xargs,sort,uniq,awk命令实现word.txt统计word次数 发布于:2023-03-14 10:47 工业互联网日报 发布于:2023-03-06 12:52 初次使用shell测试 发布于:2023-03-04 21:31 while 循环123 发布于:2023-03-01 22:48 检测两台服务器指定目录下的文件一致性 发布于:2023-02-27 21:22 增加新的判断条件并且兼容没有设置过判断参数的项目 发布于:2023-02-24 16:03 REDIS监控 发布于:2023-02-27 09:18 shell脚本1 发布于:2023-02-21 15:08 测试shell 发布于:2023-01-31 09:46 支持库安装 发布于:2022-12-29 12:15 测试软件服务是否安装并确认是否安装 发布于:2022-12-28 14:56 自定义函数 发布于:2022-12-27 10:49 read读取控制台输入 read (选项)(参数) 发布于:2022-12-27 09:14 while循环 while [ 条件判断式 ] do 程序 done 执行结果不对,为啥呢 发布于:2022-12-26 17:49 for循环 语法二 for 变量 in 值1 值2 值3... do 程序 done 发布于:2022-12-26 17:30 for循环 发布于:2022-12-26 17:16 shell脚本测试! 发布于:2022-12-20 17:25 for字符写三行值 发布于:2022-12-19 10:49 求最大值。 发布于:2022-12-19 10:48 Shell 基础知识 发布于:2022-12-06 00:41 【Shell】测试read功能,注意两次的输入要有回车 发布于:2022-12-01 20:15 【Shell】此段代码为shell if else测试代码 发布于:2022-12-01 20:16 the number of dirctary is 13 the number of file is 16 发布于:2022-11-30 00:27 bash-测试表清理 发布于:2022-11-28 18:09 设计一个任意输入一个数,判断这个数是不是质数 发布于:2022-11-26 18:02 shell判断解压 发布于:2022-11-24 16:49 九九乘法表 发布于:2022-11-07 17:39 字符类型判断 发布于:2022-11-07 21:45 12 编写shell脚本,执行后,打印一行提示“Please input a number.”逐次打印用户输入数值,直到用户输入“end”为止。 发布于:2022-10-24 21:42 程序建立三个以输入日期为名称的文件. 发布于:2022-07-12 15:19 用户输入姓氏和名字,系统输出姓名 发布于:2022-07-12 15:01 相隔某数倍数进行打印 发布于:2022-05-25 10:21 工作测试代码 发布于:2022-05-16 14:10 shell基础语法 发布于:2022-04-11 18:29 shell脚本 发布于:2022-01-20 15:56 sssasdfsad asdf asdfa 发布于:2021-10-08 17:10 在线Shell体验 发布于:2021-08-11 09:50 在线shell体验 发布于:2021-08-11 09:45 #输入一个数字,并显示出来。 发布于:2021-08-05 17:05 r_daily_new_clue_d.sh 发布于:2021-07-22 20:34 shell脚本测试 发布于:2021-07-20 20:02 查找局域网内可ssh登录的主机(22端口) 发布于:2021-07-14 18:03 dns setting for macOS 发布于:2021-06-22 14:54 不用date编写计算时间的脚本 发布于:2021-05-23 14:11 第一个shell程序 发布于:2021-05-09 16:12 [更多]
显示目录

bind命令-设置键盘按键相关功能



bind命令

bind命令用于显示或设置键盘按键与其相关的功能。

您可以利用bind命令了解有哪些按键组合与其功能,也可以自行指定要用哪些按键组合。

语法

bind [-dlv][-f <按键配置文件>][-m <按键配置>][-q <功能>]

参数

-d  显示按键配置的内容。
-f<按键配置文件>  载入指定的按键配置文件。
-l  列出所有的功能。
-m<按键配置>  指定按键配置。
-q<功能>   显示指定功能的按键。
-v   列出目前的按键配置与其功能。

实例

显示按键组合的所有功能

# bind -l //显示按键组合的内容
abort
accept-line
alias-expand-line
arrow-key-prefix
backward-byte
backward-char
backward-delete-char
backward-kill-line
backward-kill-word
backward-word
beginning-of-history
beginning-of-line
……省略部分内容
vi-goto-mark
vi-insert-beg
vi-insertion-mode
vi-match
vi-movement-mode
vi-next-word
vi-overstrike
vi-overstrike-delete
vi-prev-word
vi-put
vi-redo
vi-replace
vi-rubout
vi-search
vi-search-again
vi-set-mark
vi-subst
vi-tilde-expand
vi-yank-arg
vi-yank-to
yank
yank-last-arg
yank-nth-arg
yank-pop

显示当前按键组合的设置

# bind -l
abort
accept-line
alias-expand-line
arrow-key-prefix
backward-byte
backward-char
backward-delete-char
backward-kill-line
backward-kill-word
backward-word
beginning-of-history
beginning-of-line
call-last-kbd-macro
capitalize-word
character-search
character-search-backward
clear-screen
complete
complete-command
complete-filename
complete-hostname
complete-into-braces
complete-username
complete-variable
copy-backward-word
copy-forward-word
copy-region-as-kill
dabbrev-expand
delete-char
delete-char-or-list
delete-horizontal-space
digit-argument
display-shell-version
do-lowercase-version
downcase-word
dump-functions
dump-macros
dump-variables
dynamic-complete-history
edit-and-execute-command
emacs-editing-mode
end-kbd-macro
end-of-history
end-of-line
exchange-point-and-mark
forward-backward-delete-char
forward-byte
forward-char
forward-search-history
forward-word
glob-complete-word
glob-expand-word
glob-list-expansions
history-and-alias-expand-line
history-expand-line
history-search-backward
history-search-forward
insert-comment
insert-completions
insert-last-argument
kill-line
kill-region
kill-whole-line
kill-word
magic-space
menu-complete
menu-complete-backward
next-history
non-incremental-forward-search-history
non-incremental-forward-search-history-again
non-incremental-reverse-search-history
non-incremental-reverse-search-history-again
old-menu-complete
operate-and-get-next
overwrite-mode
possible-command-completions
possible-completions
possible-filename-completions
possible-hostname-completions
possible-username-completions
possible-variable-completions
previous-history
quoted-insert
redraw-current-line
re-read-init-file
reverse-search-history
revert-line
self-insert
set-mark
shell-backward-kill-word
shell-backward-word
shell-expand-line
shell-forward-word
shell-kill-word
skip-csi-sequence
start-kbd-macro
tab-insert
tilde-expand
transpose-chars
transpose-words
tty-status
undo
universal-argument
unix-filename-rubout
unix-line-discard
unix-word-rubout
upcase-word
vi-append-eol
vi-append-mode
vi-arg-digit
vi-back-to-indent
vi-bword
vi-bWord
vi-change-case
vi-change-char
vi-change-to
vi-char-search
vi-column
vi-complete
vi-delete
vi-delete-to
vi-editing-mode
vi-end-word
vi-eof-maybe
vi-eword
vi-eWord
vi-fetch-history
vi-first-print
vi-fword
vi-fWord
vi-goto-mark
vi-insert-beg
vi-insertion-mode
vi-match
vi-movement-mode
vi-next-word
vi-overstrike
vi-overstrike-delete
vi-prev-word
vi-put
vi-redo
vi-replace
vi-rubout
vi-search
vi-search-again
vi-set-mark
vi-subst
vi-tilde-expand
vi-yank-arg
vi-yank-to
yank
yank-last-arg
yank-nth-arg
yank-pop
root@snail-hnlinux:~# 
root@snail-hnlinux:~# 
root@snail-hnlinux:~# 
root@snail-hnlinux:~# 
root@snail-hnlinux:~# bind -v
set bind-tty-special-chars on
set blink-matching-paren on
set byte-oriented off
set completion-ignore-case off
set convert-meta off
set disable-completion off
set echo-control-characters on
set enable-keypad off
set enable-meta-key on
set expand-tilde off
set history-preserve-point off
set horizontal-scroll-mode off
set input-meta on
set mark-directories on
set mark-modified-lines off
set mark-symlinked-directories off
set match-hidden-files on
set meta-flag on
set output-meta on
set page-completions on
set prefer-visible-bell on
set print-completions-horizontally off
set revert-all-at-newline off
set show-all-if-ambiguous off
set show-all-if-unmodified off
set skip-completed-text off
set visible-stats off
set bell-style audible
set comment-begin #
set completion-prefix-display-length 0
set completion-query-items 100
set editing-mode emacs
set history-size 1000
set keymap emacs

列出指定功能的按键和按键组合

# bind -q abort
//请用 调用abort “C-g”, “C-xC-g”, “eC-g”.

# bind -q accept-line //列出功能“accept-line”按键以及组合按键
//请用 调用accept-line “C-j”, “C-m”.
由JSRUN为你提供的Shell/Bash在线运行、在线编译工具
        JSRUN提供的Shell/Bash 在线运行,Shell/Bash 在线运行工具,基于linux操作系统环境提供线上编译和线上运行,具有运行快速,运行结果与常用开发、生产环境保持一致的特点。