Skip to Content
bash shell脚本编程经典实例 (第2版)
book

bash shell脚本编程经典实例 (第2版)

by Carl Albing, JP Vossen
January 2021
Intermediate to advanced
581 pages
15h 7m
Chinese
Posts & Telecom Press
Content preview from bash shell脚本编程经典实例 (第2版)
bash
的配置与自定义
369
16.9.4
 参考
help set
help shopt
Bash Reference Manual
A.6
A.7
A.8
16.10
 用
.inputrc
调整
readline
的行为
16.10.1
 问题
你想要调整
bash
处理输入的方式,尤其是命令补全。例如,你希望能够忽略大小写。
16.10.2
 解决方案
根据情况,编辑或创建适合的
~/.inputrc
/etc/inputrc
文件。有大量的选项可供你根据
喜好调整。要想
readline
在初始化时使用你所提供的文件,可以设置
$INPUTRC
,例如,
INPUTRC=~/.inputrc
。要想重新读取文件并应用设置,或修改后进行测试,可以使用
bind
-f
filename
我们推荐你研究一下
readline
的文件以及
bind
命令,尤其是
bind -v
bind -l
bind -s
bind -p
,最后一个命令涉及的内容颇多,而且晦涩难懂。
有关
readline
的更多配置信息,参见
A.18
节。对于来自其他环境(尤其是
Windows
)的
用户比较有用的配置是:
# 这是inputrc设置中值得注意的一部分,更长的示例参见16.22
# 要想重新读取(并应用对该文件做出的改动),可以使用:
# bind -f $SETTINGS/inputrc
# 首先,纳入/etc/inputrc中所有的系统范围绑定和变量赋值
#(如果文件不存在,则静默失败)
$include /etc/inputrc ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

bash 网络安全运维

bash 网络安全运维

Paul Troncone, Carl Albing
Linux 内核观测技术BPF

Linux 内核观测技术BPF

David Calavera, Lorenzo Fontana

Publisher Resources

ISBN: 9787115553782