{"title":"Bash","authors":"R. Fox","doi":"10.1201/9781003203322-2","DOIUrl":null,"url":null,"abstract":"A Unix shell provides an interface that lets the user interact with the operating system by running commands. But a shell is also a fairly rich programming language: there are constructs for flow control, alternation, looping, conditionals, basic mathematical operations, named functions, string variables, and two-way communication between the shell and the commands it invokes. Shells can be used interactively, from a terminal or terminal emulator such as xterm, and non-interactively, reading commands from a file. Most modern shells, including bash, provide command-line editing, in which the command line can be manipulated using emacsor vi-like commands while it’s being entered, and various forms of a saved history of commands. Bash processing is much like a shell pipeline: after being read from the terminal or a script, data is passed through a number of stages, transformed at each step, until the shell finally executes a command and collects its return status. This chapter will explore bash’s major components: input processing, parsing, the various word expansions and other command processing, and command execution, from the pipeline perspective. These components act as a pipeline for data read from the keyboard or from a file, turning it into an executed command.","PeriodicalId":375576,"journal":{"name":"Linux with Operating System Concepts","volume":"11 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-11-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Linux with Operating System Concepts","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1201/9781003203322-2","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

A Unix shell provides an interface that lets the user interact with the operating system by running commands. But a shell is also a fairly rich programming language: there are constructs for flow control, alternation, looping, conditionals, basic mathematical operations, named functions, string variables, and two-way communication between the shell and the commands it invokes. Shells can be used interactively, from a terminal or terminal emulator such as xterm, and non-interactively, reading commands from a file. Most modern shells, including bash, provide command-line editing, in which the command line can be manipulated using emacsor vi-like commands while it’s being entered, and various forms of a saved history of commands. Bash processing is much like a shell pipeline: after being read from the terminal or a script, data is passed through a number of stages, transformed at each step, until the shell finally executes a command and collects its return status. This chapter will explore bash’s major components: input processing, parsing, the various word expansions and other command processing, and command execution, from the pipeline perspective. These components act as a pipeline for data read from the keyboard or from a file, turning it into an executed command.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
Bash
Unix shell提供了一个接口,允许用户通过运行命令与操作系统进行交互。但是shell也是一种相当丰富的编程语言:有流控制、交替、循环、条件、基本数学运算、命名函数、字符串变量的结构,以及shell和它调用的命令之间的双向通信。可以从终端或终端模拟器(如xterm)交互式地使用shell,也可以从非交互式地从文件读取命令使用shell。包括bash在内的大多数现代shell都提供命令行编辑功能,可以在输入命令行时使用类似emacsor vi的命令对命令行进行操作,还提供各种形式的命令保存历史记录。Bash处理非常类似于shell管道:从终端或脚本读取数据后,数据要经过许多阶段,每一步都进行转换,直到shell最终执行命令并收集其返回状态。本章将从管道的角度探讨bash的主要组件:输入处理、解析、各种字展开和其他命令处理,以及命令执行。这些组件充当从键盘或文件读取数据的管道,将其转换为可执行的命令。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Shell Scripting Network Configuration Linux User Accounts Bash
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1