亚麻籽是什么| 中医经方是什么意思| 伸筋草长什么样子| 77年属什么生肖| 间质性肺炎是什么意思| 左脸上长痘痘是什么原因| 四眼狗有什么迷信说法| 头什么脚什么| 什么动物吃蜘蛛| 婴儿湿疹用什么药膏最有效| 金兰之交是什么意思| 河南有什么特产| 七五年属什么生肖| 早射吃什么药可以调理| 菲律宾货币叫什么| 月经期喝什么水最好| 面基是什么意思啊| 宾格是什么意思| 脱发严重应该去医院挂什么科| 巳火是什么火| 被艹是什么感觉| 以什么之名| 茶壶嘴为什么不能对着人| 食色性也是什么意思| 咳嗽有白痰吃什么药最好| 排湿气最快的方法吃什么| 经络是什么意思| 绿对什么| 什么叫早教| 姨妈期吃什么水果| 咳嗽咳出血是什么原因| 梦见红色的蛇是什么意思| 死而什么什么| 粉墙用什么| 腋下疣是什么原因造成的| 食人鱼的天敌是什么| 热射病是什么| 仙逝是什么意思| 一度电是什么概念| uniqlo是什么牌子| 维生素d缺乏吃什么药| 肥肠炒什么菜好吃| 春秋鼎盛是什么意思| 痛风有什么不能吃| 施华洛世奇算什么档次| 口腔溃疡长什么样| 牙周炎用什么药| 二代试管是什么意思| 什么样的手相最有福气| 广东省省长什么级别| 得意忘形是什么意思| 8月3号是什么星座| 老是瞌睡是什么原因| 牙齿一碰就疼是什么原因| 肾出问题了有什么症状| 做体检挂什么科| 大姨妈期间同房有什么影响| 肛门瘙痒用什么药膏好| 天荒地老什么意思| 记忆力减退是什么原因造成的| 鬼火是什么意思| 早餐可以吃什么| 参谋长是什么军衔| 菌群失调是什么意思| 血小板减少是什么原因| 萌萌哒是什么意思| 什么弟什么兄| 什么是黑咖啡| 为什么晕车| 为什么要打胰岛素| 广州白云区有什么好玩的地方| 扁平疣是什么原因造成的| 8月5日是什么星座| 十一月一号是什么星座| 宗气是什么意思| 姜红枣红糖一起煮有什么效果| 饮片是什么意思| 25分贝相当于什么声音| 腊八节吃什么| 有氧运动是什么意思| 土崩瓦解是什么意思| 仙鹤代表什么生肖| 男性疝气是什么病| 鼻窦炎有什么症状表现| 射手男和什么座最配对| 挂靠是什么意思| 细菌性结膜炎用什么眼药水| 钟馗是什么人物| 床虱咬了要擦什么药膏| 皮肤湿疹用什么药膏| 大豆油是什么豆做的| 洁身自爱是什么意思| 什么样的小船| 步兵什么意思| 宫颈机能不全是什么原因造成的| 大象的天敌是什么动物| 左眼皮一直跳是什么原因| 雌蕊由什么组成| 崎胎瘤是什么| 复杂性囊肿是什么意思| 贫血吃什么食物| 科长是什么级别| 常熟有什么好玩的地方| 黑加京念什么| 婴儿掉头发是什么原因| 代谢是什么| 9个月宝宝玩什么玩具| 下海是什么意思| 肾积水有什么症状| 老好人是什么意思| 备孕不应该吃什么| 消谷善饥是什么意思| bv是什么品牌| 乙肝核心抗体是什么意思| 乳腺钼靶是什么意思| 疱疹是什么症状| 失眠睡不着吃什么药好| 单脱是什么意思| 三观不合是什么意思| 碳水化合物是什么食物| 膝盖骨质增生用什么药效果好| 修复子宫内膜吃什么药| 巨人观是什么意思| runosd是什么牌子的手表| 生肖鸡和什么生肖最配| 阴道没水什么原因| hcv是什么病| 女娲用什么补天| 流产后吃什么食物| 杨新鸣包贝尔什么关系| 呕吐是什么原因引起的| 6月29日什么星座| 痔疮什么东西不能吃| 辟谷是什么都不吃吗| 四月二十四是什么星座| 热感冒流鼻涕吃什么药| 胆囊炎吃什么中成药| 下缘达宫颈内口是什么意思| 画龙点睛是什么意思| 高危型hpv52阳性是什么意思| 托大是什么意思| 温煦是什么意思| 梦见煮饭是什么意思| 尿电导率低是什么意思| 大小便失禁是什么原因| 为什么突然长痣| 什么是女人味| 全身骨显像是查什么的| 暖巢早衰是什么原因| 哦多桑是什么意思| 飞蚊症滴什么眼药水| 寒冷性荨麻疹是什么原因引起的| 叶酸不能和什么一起吃| 专升本需要考什么| 全能神是什么| 半路杀出个程咬金是什么意思| 眼角痒用什么眼药水| 12朵玫瑰代表什么意思| 骨折和断了有什么区别| 炖羊汤放什么调料| 什么情况下需要做活检| 什么是骨刺| 10月28日是什么日子| 经期适合喝什么茶| 仰天长叹的意思是什么| 被电击后身体会有什么后遗症| 梦见已故老人是什么预兆| 梦见小麦粒是什么意思| 肾外肾盂是什么意思| 什么的樱桃| 无所不用其极是什么意思| 孩子咳嗽有痰吃什么药| 孕妇吃蓝莓对胎儿有什么好处| 元旦北京有什么好玩的| 有龙则灵的灵是什么意思| 事业有成是什么意思| 为什么脚会有酸臭味| 益生菌有什么好处| 眩晕症是什么原因造成的| 女人背心正中间疼是什么原因| 胃绞痛吃什么药| 市人大副主任什么级别| 很多屁放是什么原因| 我要控制我自己是什么歌| 死忠粉是什么意思| 面包是什么意思| cbd什么意思| 金价下跌意味着什么| 根基是什么意思| 交警支队长是什么级别| 略施小计是什么动物| 白斩鸡是什么意思| 扁桃体发炎用什么药| 吃槟榔有什么好处和坏处| 底线是什么意思| 就此别过是什么意思| 侍郎是什么官职| 头发爱出油什么原因| 泽五行属什么| 饭中吃药是什么时候吃| 3月5日是什么纪念日| 回肠荡气什么意思| 春天有什么特点| 搪塞是什么意思| 气血不足有什么症状| 检验科是做什么的| 一个月一个元念什么| 小孩一到晚上就发烧是什么原因| 正月十六是什么星座| 右下腹疼挂什么科| 前列腺炎需要做什么检查| 梵蒂冈为什么没人敢打| 渚是什么意思| 益生菌和益生元有什么区别| 甲状腺偏高有什么影响| 南京鸡鸣寺求什么灵| 舌头烧灼感吃什么药| 不宁腿综合症吃什么药| ibm是做什么的| 咖啡烘培度有什么区别| 青色是什么颜色| 吃完饭恶心想吐是什么原因| 莲子心有什么功效| 七六年属什么| 007什么意思| 碘吃多了有什么危害| 生姜黄叶病用什么药| 副支队长是什么级别| 舌头灼热感是什么原因| 乳腺增生吃什么食物好| lcu是什么意思| 嘴唇上起泡是什么原因| 口腔溃疡是什么引起的| 晚上咳嗽是什么原因| anode是什么意思| 没有高中毕业证有什么影响| 膀胱钙化是什么意思| 梦见好多水果是什么预兆| 穿山甲到底说了什么| 1969年属什么| 山海经讲的是什么| 爸爸的舅舅叫什么| 子宫肌瘤做什么检查能查出来| 脸两侧长痘痘是什么原因| 多吃蒜有什么好处和坏处| 几斤几两是什么意思| 鼻炎吃什么食物好得快| 什么时候是安全期| 寄大件用什么物流便宜| 冰箱灯不亮是什么原因| 什么人需要做肠镜检查| 2035年属什么生肖| 夏至吃什么传统食物| 17楼五行属什么| 樱桃红是什么颜色| 心脏无力吃什么药最好| 郑板桥擅长画什么| 甲状腺结节忌口什么| 梭边鱼是什么鱼| 动脉硬化吃什么药最好| 阴唇肥大有什么影响| 子息克乏是什么意思| 腰疼吃点什么药| 蜘蛛侠叫什么名字| 百度Jump to content

面部发红是什么原因

From Wikipedia, the free encyclopedia
百度 教师的身份第一次被政策文件明确表述为“国家公职人员”,这意味着教师的教育教学行为代表着国家的意志;教师具有“特殊的法律地位”,意味着教师工作的特殊性,需要赋予教师职业某种特定的、法律予以保护的地位。

Screen shot of a terminal showing various Bash commands and resulting output.

This article catalogs comparable aspects of notable operating system shells.

General characteristics

[edit]

Interactive features

[edit]

Background execution

[edit]

Background execution allows a shell to run a command without user interaction in the terminal, freeing the command line for additional work with the shell. POSIX shells and other Unix shells allow background execution by using the & character at the end of command.

Completions

[edit]
Command-line completion in Bash.

Completion features assist the user in typing commands at the command line, by looking for and suggesting matching words for incomplete ones. Completion is generally requested by pressing the completion key (often the Tab ? key).

Command name completion is the completion of the name of a command. In most shells, a command can be a program in the command path (usually $PATH), a builtin command, a function or alias.

Path completion is the completion of the path to a file, relative or absolute.

Wildcard completion is a generalization of path completion, where an expression matches any number of files, using any supported syntax for file matching.

Variable completion is the completion of the name of a variable name (environment variable or shell variable). Bash, zsh, and fish have completion for all variable names. PowerShell has completions for environment variable names, shell variable names and — from within user-defined functions — parameter names.

Command argument completion is the completion of a specific command's arguments. There are two types of arguments, named and positional: Named arguments, often called options, are identified by their name or letter preceding a value, whereas positional arguments consist only of the value. Some shells allow completion of argument names, but few support completing values.

Bash, zsh and fish offer parameter name completion through a definition external to the command, distributed in a separate completion definition file. For command parameter name/value completions, these shells assume path/filename completion if no completion is defined for the command. Completion can be set up to dynamically suggest completions by calling a shell function.[43] The fish shell additionally supports parsing of man pages to extract parameter information that can be used to improve completions/suggestions. In PowerShell, all types of commands (cmdlets, functions, script files) inherently expose data about the names, types and valid value ranges/lists for each argument. This metadata is used by PowerShell to automatically support argument name and value completion for built-in commands/functions, user-defined commands/functions as well as for script files. Individual cmdlets can also define dynamic completion of argument values where the completion values are computed dynamically on the running system.

Command history

[edit]

Users of a shell may find themselves typing something similar to what they have typed before. Support for command history means that a user can recall a previous command into the command-line editor and edit it before issuing the potentially modified command.

Shells that support completion may also be able to directly complete the command from the command history given a partial/initial part of the previous command.

Most modern shells support command history. Shells which support command history in general also support completion from history rather than just recalling commands from the history. In addition to the plain command text, PowerShell also records execution start- and end time and execution status in the command history.

Mandatory argument prompt

[edit]

Mandatory arguments/parameters are arguments/parameters which must be assigned a value upon invocation of the command, function or script file. A shell that can determine ahead of invocation that there are missing mandatory values, can assist the interactive user by prompting for those values instead of letting the command fail. Having the shell prompt for missing values will allow the author of a script, command or function to mark a parameter as mandatory instead of creating script code to either prompt for the missing values (after determining that it is being run interactively) or fail with a message.

Automatic suggestions

[edit]
Command-line completion in PowerShell.

Shells featuring automatic suggestions display optional command-line completions as the user types. The PowerShell and fish shells natively support this feature; pressing the Tab ? key inserts the completion.

Implementations of this feature can differ between shells; for example, PowerShell[44] and zsh[45] use an external module to provide completions, and fish derives its completions from the user's command history.[46]

Directory history, stack or similar features

[edit]

Shells may record a history of directories the user has been in and allow for fast switching to any recorded location. This is referred to as a "directory stack". The concept had been realized as early as 1978[47] in the release of the C shell (csh).

Command line interpreters 4DOS and its graphical successor Take Command Console also feature a directory stack.

Implicit directory change

[edit]

A directory name can be used directly as a command which implicitly changes the current location to the directory.

This must be distinguished from an unrelated load drive feature supported by Concurrent DOS, Multiuser DOS, System Manager and REAL/32, where the drive letter L: will be implicitly updated to point to the load path of a loaded application, thereby allowing applications to refer to files residing in their load directory under a standardized drive letter instead of under an absolute path.[48]

Autocorrection

[edit]
Zsh autocompletion and autocorrection demo for a telnet program.

When a command line does not match a command or arguments directly, spell checking can automatically correct common typing mistakes (such as case sensitivity, missing letters). There are two approaches to this; the shell can either suggest probable corrections upon command invocation, or this can happen earlier as part of a completion or autosuggestion.

The tcsh and zsh shells feature optional spell checking/correction, upon command invocation.

Fish does the autocorrection upon completion and autosuggestion. The feature is therefore not in the way when typing out the whole command and pressing enter, whereas extensive use of the tab and right-arrow keys makes the shell mostly case insensitive.

The PSReadLine[31] PowerShell module (which is shipped with version 5.0) provides the option to specify a CommandValidationHandler ScriptBlock which runs before submitting the command. This allows for custom correcting of commonly mistyped commands, and verification before actually running the command.

Progress indicator

[edit]

A shell script (or job) can report progress of long running tasks to the interactive user.

Unix/Linux systems may offer other tools support using progress indicators from scripts or as standalone-commands, such as the program "pv".[49] These are not integrated features of the shells, however.

Colored directory listings

[edit]

JP Software command-line processors provide user-configurable colorization of file and directory names in directory listings based on their file extension and/or attributes through an optionally defined %COLORDIR% environment variable.

For the Unix/Linux shells, this is a feature of the ls command and the terminal.

Text highlighting

[edit]

The command line processors in DOS Plus, Multiuser DOS, REAL/32 and in all versions of DR-DOS support a number of optional environment variables to define escape sequences allowing to control text highlighting, reversion or colorization for display or print purposes in commands like TYPE. All mentioned command line processors support %$ON% and %$OFF%. If defined, these sequences will be emitted before and after filenames. A typical sequence for %$ON% would be \033[1m in conjunction with ANSI.SYS, \033p for an ASCII terminal or \016 for an IBM or ESC/P printer. Likewise, typical sequences for %$OFF% would be \033[0m, \033q, \024, respectively. The variables %$HEADER% and %$FOOTER% are only supported by COMMAND.COM in DR-DOS 7.02 and higher to define sequences emitted before and after text blocks in order to control text highlighting, pagination or other formatting options.

For the Unix/Linux shells, this is a feature of the terminal.

Syntax highlighting

[edit]

A defining feature of the fish shell is built-in syntax highlighting, As the user types, text is colored to represent whether the input is a valid command or not (the executable exists and the user has permissions to run it), and valid file paths are underlined.[50]

An independent project offers syntax highlighting as an add-on to the Z Shell (zsh).[51] This is not part of the shell, however.

PowerShell provides customizable syntax highlighting on the command line through the PSReadLine[31] module. This module can be used with PowerShell v3.0+, and is bundled with v5.0 onwards. It is loaded by default in the command line host "powershell.exe" since v5.0.[52]

Take Command Console (TCC) offers syntax highlighting in the integrated environment.

Context sensitive help

[edit]

4DOS, 4OS2, 4NT / Take Command Console and PowerShell (in PowerShell ISE) looks up context-sensitive help information when F1 is pressed.

Zsh provides various forms of configurable context-sensitive help as part of its run-help widget, _complete_help command, or in the completion of options for some commands.

The fish shell provides brief descriptions of a command's flags during tab completion.

Programming features

[edit]
Shell Functions Exception handling Search & replace
on variable substi-tutions
Arithmetic
Math function library Linear arrays or lists Pseudo-random number generation Bytecode
Bourne shell 1977 version No Yes (via trap) No No No No No No No Yes No No
Bourne shell current version Yes since SVR2 Yes (via trap) No Yes[nb 8] No No No No No Yes No No
POSIX shell Yes Yes (via trap) No Yes No No No No No Yes No No
bash (v4.0) Yes Yes (via trap) Yes
(via ${//} syntax)
Yes No No Yes Yes No Yes Yes
($RANDOM)
No
csh No No Yes
(via $var:s/// syntax)
Yes No No Yes No No Yes No No
tcsh Work in progress[53] No Yes
(via $var:s/// syntax)
Yes No No Yes No No Yes No No
Hamilton C shell Yes No Yes
(via $var:s/// syntax)
Yes Yes Yes Yes No No Yes Yes (random utility) No
Scsh Yes ? Yes
(via string functions and regular expressions)
? ? ? Yes ? Yes Yes Yes
(random-integer, random-real)
Yes
(compiler is Scheme48 virtual machine, via scshvm)
ksh (ksh93t+) Yes Yes (via trap) Yes
(via ${//} syntax and builtin commands)
Yes Yes Yes Yes Yes No Yes Yes
($RANDOM)
Yes
(compiler is called shcomp)
pdksh Yes Yes (via trap) No Yes No No Yes No No Yes Yes
($RANDOM)
No
zsh Yes Yes Yes
(via ${:s//} and ${//} syntax)
Yes Yes Yes
(zsh/mathfunc module)
Yes Yes No Yes Yes
($RANDOM)
Yes
(built-in zcompile command)
ash Yes Yes (via trap) No Yes
(since 1992)[54]
No No No No No Yes No No
CCP No ? No No ? ? No No No No No No
COMMAND.COM No Partial (only Auto-fail (via COMMAND /F (or /N in some versions of DR-DOS)) No No No No No No No No No No
OS/2 CMD.EXE No No No ? No No ? No No No No No
Windows CMD.EXE Yes
(via CALL :label)
No Yes
(via SET %varname:expression syntax)
Yes
(via SET /A)[55]
No No Yes
(via SET[56])
No No No Yes
(%random%)
No
4DOS Yes Yes
(via ON command, optional Auto-fail via 4DOS /F)
Yes
(via %@Replace[...] function)
Yes
(via SET /A)
? ? Yes
(via ranges, include lists, @file lists and FOR command)
No No Yes Yes
(%@Random[...] function)
Yes
(via BATCOMP command)
4OS2 ? ? ? ? ? ? ? ? No Yes Yes (%@Random[...] function) ?
TCC (formerly 4NT) Yes Yes
(via ON and various ...MONITOR commands)
Yes
(via %@Replace[...] function)
Yes
(via SET /A)
? ? Yes
(via ranges, include lists, @file lists and FOR command)
? No Yes Yes (%@Random[...] function) Yes (via BATCOMP command)
PowerShell Yes Yes (Try-Catch-Finally) Yes
(-replace operator)
Yes Yes [Math] class[57] Yes Yes Yes[58] Yes Yes Yes, automatic
rc Yes Yes No Yes ? ? Yes ? No Yes No No
BeanShell Yes Yes ? Yes ? ? Yes Yes No Yes Yes Yes
VMS DCL Yes Yes No Yes No yes, for compiled programs Yes No No No No No
fish Yes Yes (via trap) Yes, via string builtin command[59] Yes Yes Yes Yes No No Yes Yes
(random)
No

String processing and filename matching

[edit]
Shell String processing Alternation (Brace expansion) Pattern matching (regular expressions built-in) Pattern matching (filename globbing) Globbing qualifiers (filename generation based on file attributes) Recursive globbing (generating files from any level of subdirectories)
Bourne shell 1977 version ? No No Yes
(*, ?, [...])
No No
Bourne shell recent version Partial (prefix and suffix stripping in variable expansion) No No Yes
(*, ?, [...])
No No
POSIX shell Partial (prefix and suffix stripping in variable expansion) No No Yes
(*, ?, [...])
No No
bash (v4.0) Partial (prefix and suffix stripping in variable expansion) Yes Yes Yes
(*, ?, [...], {...})
No Yes (**/...)
csh Yes
(:s and other editing operators)
Yes No Yes No No
tcsh Yes
(:s and other editing operators)
Yes Yes Yes No No
Hamilton C shell Yes
(:s and other editing operators + substr, strlen, strindex, printf, reverse, upper, lower, concat and other builtin functions)
Yes No Yes No Yes
(via indefinite directory "..." wildcard[60])
Scsh ? ? Yes Yes No No
ksh (ksh93t+) Partial (prefix, suffix stripping and string replacement in variable expansion) Yes[61] Yes Yes
(*, ?, [...])
No Yes (with set -G, no following of symlinks)
pdksh ? Yes[61] No Yes No No
zsh Yes (through variable processing: e.g. substring extraction, various transformations via parameter expansion) Yes Yes Yes
(*, ?, [...], extended globbing[62])
Yes Yes (**/... or ***/... to follow symlinks)
ash ? ? No Yes No No
CCP No No No No No No
COMMAND.COM No No No Yes
(*, ?)
No No
OS/2 CMD.EXE No No No Yes
(*, ?)
Partial (only in DIR /A:... command) No
Windows CMD.EXE Partial (only through FOR /F and SET /A) No No[nb 17] Yes
(*, ?)
Partial (only in DIR /A:... command) Yes (via FOR /R command, or, where available, indirectly via /S subdir option)
4DOS Yes (through variable functions %@...[], extended environment variable processing, various string commands and FOR /F and SET /A) No No Yes
(*, ?, [...], extended wildcards, SELECT popup command)
Yes (via /A:... attribute and /I"..." description options and /[S...] size, /[T...] time, /[D...] date, and /[!...] file exclusion ranges) Yes (via FOR /R command, or indirectly via GLOBAL command or, where available, /S subdir option)
4OS2 ? No No ? ? ?
TCC (formerly 4NT) Yes (through variable functions %@...[], extended environment variable processing, various string commands and FOR /F and SET /A) No Yes Yes
(*, ?, [...], extended wildcards, SELECT popup command)
Yes (via /A:... attribute and /I"..." description options and /[S...] size, /[T...] time, /[D...] date, /[O...] owner, and /[!...] file exclusion ranges) Yes (via FOR /R command, or indirectly via GLOBAL command or, where available, /S subdir option)
PowerShell Yes
(Concat/Substring/Insert/Remove/Replace, ToLower/ToUpper, Trim/TrimStart/TrimEnd, Compare, Contains/StartsWith/EndWith, Format, IndexOf/LastIndexOf, Pad/PadLeft/PadRight, Split/Join, regular expression functions and other .NET string functions)
Range operator for numbers[63] Yes
(full regex support)[nb 18]
Yes
(*, ?, [...])
? ?
rc ? ? No Yes No No
BeanShell ? ? Yes ? ? ?
VMS DCL Yes No No Yes No Yes (via [SUBDIR...])
fish Yes
(builtin string function)
Yes Yes
(via builtin string match and string replace functions)
Yes
(*, ?, {...})
No Yes (**/...)

Inter-process communication

[edit]
Shell Pipes Command substitution Process substitution Subshells TCP/UDP connections as streams Keystroke stacking
Bourne shell bytes concurrent Yes No Yes No N/A[nb 19]
POSIX shell bytes concurrent Yes No Yes No N/A[nb 19]
bash (v4.0) bytes concurrent Yes Yes
(if system supports /dev/fd/?n? or named pipes)
Yes Yes
(client only)
N/A[nb 19]
csh bytes concurrent Yes No Yes No N/A[nb 19]
tcsh bytes concurrent Yes No Yes No N/A[nb 19]
Hamilton C shell bytes concurrent Yes No Yes No ?
Scsh text ? ? ? Yes N/A[nb 19]
ksh (ksh93t+) bytes (may contain serialized objects if print -C is used) concurrent Yes
($(...) and ${<space>...;})
Yes
(if system supports /dev/fd/?n?)
Yes Yes
(and SCTP support, client only)
N/A[nb 19]
pdksh bytes concurrent Yes No Yes No N/A[nb 19]
zsh bytes concurrent Yes Yes Yes Yes
(client and server, but only TCP)
N/A[nb 19]
ash bytes concurrent Yes No Yes No N/A[nb 19]
CCP No No No No No No
COMMAND.COM text sequential temporary files No No Partial (only under DR-DOS multitasker via COMMAND.COM /T) No No
OS/2 CMD.EXE text concurrent No No ? No No
Windows CMD.EXE text concurrent Yes
(via FOR /F command)
No Yes
(Backtick: ` in FOR /F usebackq)
No No
4DOS text sequential temporary files Yes
(via FOR /F command)
? Partial (via %@EXECSTR[] and %@EXEC[], or via SET /M, ESET /M and UNSET /M and %@MASTER[...]) No Yes (via KEYSTACK and KSTACK)[64]
4OS2 text concurrent ? ? ? No Yes (via KEYSTACK)
TCC (formerly 4NT) text concurrent Yes
(via FOR /F command)
? Partial (via %@EXECSTR[] and %@EXEC[]) Yes (via FTP, TFTP, FTPS, SFTP, HTTP, HTTPS and IFTP, client only) Yes (via KEYSTACK)
PowerShell objects concurrent Yes No Yes Yes ?
rc text concurrent Yes Yes
(via: <{cmd} if system supports /dev/fd/?n?)
Yes No ?
BeanShell not supported ? ? ? Yes ?
VMS DCL text (via PIPE command) Yes No Yes
(spawn)
Yes
(server TCP only)
No
fish bytes concurrent Yes (...) No (broken)[65] No No N/A[nb 19]

Keystroke stacking

[edit]

In anticipation of what a given running application may accept as keyboard input, the user of the shell instructs the shell to generate a sequence of simulated keystrokes, which the application will interpret as a keyboard input from an interactive user. By sending keystroke sequences the user may be able to direct the application to perform actions that would be impossible to achieve through input redirection or would otherwise require an interactive user. For example, if an application acts on keystrokes, which cannot be redirected, distinguishes between normal and extended keys, flushes the queue before accepting new input on startup or under certain conditions, or because it does not read through standard input at all. Keystroke stacking typically also provides means to control the timing of simulated keys being sent or to delay new keys until the queue was flushed etc. It also allows to simulate keys which are not present on a keyboard (because the corresponding keys do not physically exist or because a different keyboard layout is being used) and therefore would be impossible to type by a user.

Security features

[edit]
Shell Secure (password) prompt File/directory passwords Execute permission Restricted shell subset Safe data subset
Bourne shell via stty[nb 20] ? N/A[nb 21] Yes No
POSIX shell via stty[nb 20] ? N/A[nb 21] No No
bash (v4.0) read -s ? N/A[nb 21] Yes No
csh via stty[nb 20] ? N/A[nb 21] Yes No
tcsh via stty[nb 20] ? N/A[nb 21] Yes No
Hamilton C shell No No No No No
Scsh via stty[nb 20] ? N/A[nb 21] No No
ksh (ksh93t+) via stty[nb 20] ? N/A[nb 21] Yes No
pdksh via stty[nb 20] ? N/A[nb 21] Yes No
zsh read -s ? N/A[nb 21][nb 22] Yes No
ash via stty[nb 20] ? N/A[nb 21] Yes No
CCP No No No No No
COMMAND.COM Partial (only under DR-DOS, prompts for password if file/directory is protected) Partial (only under DR-DOS via \dirname;dirpwd\filename;filepwd syntax)[nb 23] Partial (only under DR-DOS, if files are password-protected for read and/or execute permission)[nb 24] No No
OS/2 CMD.EXE No No No No No
Windows CMD.EXE No No No No No
4DOS Yes (via INPUT /P or INKEY /P)[nb 25] Partial (only under DR-DOS via \dirname;;dirpwd\filename;;filepwd syntax)[nb 23] Partial (only under DR-DOS, if files are password-protected for read and/or execute permission)[nb 24] No No
4OS2 ? No No No No
TCC (formerly 4NT) Yes (via INPUT /P, INKEY /P or QUERYBOX /P)[nb 25] No No No No
PowerShell Yes[nb 26] No No[nb 27] Yes[nb 28] Yes[66]
rc via stty[nb 20] ? N/A[nb 21] Yes[67] No
BeanShell ? ? ? ? ?
VMS DCL Yes No Yes Yes No
fish read -s ? N/A[nb 21][nb 22] Yes (via fish -l) ?

Secure prompt

[edit]

Some shell scripts need to query the user for sensitive information such as passwords, private digital keys, PIN codes or other confidential information. Sensitive input should not be echoed back to the screen/input device where it could be gleaned by unauthorized persons. Plaintext memory representation of sensitive information should also be avoided as it could allow the information to be compromised, e.g., through swap files, core dumps etc.[68]

The shells bash, zsh and PowerShell offer this as a specific feature.[69][70] Shells which do not offer this as a specific feature may still be able to turn off echoing through some other means. Shells executing on a Unix/Linux operating system can use the stty external command to switch off/on echoing of input characters.[71] In addition to not echoing back the characters, PowerShell's -AsSecureString option also encrypts the input character-by-character during the input process, ensuring that the string is never represented unencrypted in memory where it could be compromised through memory dumps, scanning, transcription etc.

Execute permission

[edit]

Some operating systems define an execute permission which can be granted to users/groups for a file when the file system itself supports it.

On Unix systems, the execute permission controls access to invoking the file as a program, and applies both to executables and scripts. As the permission is enforced in the program loader, no obligation is needed from the invoking program, nor the invoked program, in enforcing the execute permission – this also goes for shells and other interpreter programs. The behaviour is mandated by the POSIX C library that is used for interfacing with the kernel. POSIX specifies that the exec family of functions shall fail with EACCESS (permission denied) if the file denies execution permission (see execve – System Interfaces Reference, The Single UNIX Specification, Version 5 from The Open Group).

The execute permission only applies when the script is run directly. If a script is invoked as an argument to the interpreting shell, it will be executed regardless of whether the user holds the execute permission for that script.

Although Windows also specifies an execute permission, none of the Windows-specific shells block script execution if the permission has not been granted.

Restricted shell subset

[edit]

Several shells can be started or be configured to start in a mode where only a limited set of commands and actions is available to the user. While not a security boundary (the command accessing a resource is blocked rather than the resource) this is nevertheless typically used to restrict users' actions before logging in.

A restricted mode is part of the POSIX specification for shells, and most of the Linux/Unix shells support such a mode where several of the built-in commands are disabled and only external commands from a certain directory can be invoked.[72][73]

PowerShell supports restricted modes through session configuration files or session configurations. A session configuration file can define visible (available) cmdlets, aliases, functions, path providers and more.[74]

Safe data subset

[edit]

Scripts that invoke other scripts can be a security risk as they can potentially execute foreign code in the context of the user who launched the initial script. Scripts will usually be designed to exclusively include scripts from known safe locations; but in some instances, e.g. when offering the user a way to configure the environment or loading localized messages, the script may need to include other scripts/files.[75] One way to address this risk is for the shell to offer a safe subset of commands which can be executed by an included script.

Notes

[edit]
  1. ^ Since mid 1990s.
  2. ^ if compiled with -DACCT.
  3. ^ MS-DOS and Windows component – covered by a valid license for MS-DOS or Microsoft Windows.
  4. ^ OS/2 component – covered by a valid license for OS/2.
  5. ^ Command extensions enabled, or "CMD /X".
  6. ^ Windows component – covered by a valid license for Microsoft Windows.
  7. ^ Microsoft PowerShell is installed by default on Windows 7 and later. It is an optional download for users of Windows Vista or Windows XP.
  8. ^ a b c current versions from J?rg Schilling.
  9. ^ Alt-Shift-8 or Alt-* will expand to the full matching list of filenames.
  10. ^ Available through the DOSKEY add-on.
  11. ^ Available in DR-DOS through HISTORY.
  12. ^ Alternatively available through the DOSKEY add-on as well.
  13. ^ Alternatively available in DR-DOS through HISTORY as well.
  14. ^ TCC has special prompt functions for Yes, No, Cancel, Close, Retry.
  15. ^ a b c Handled by rio, GNU readline, editline or vrl.
  16. ^ The fish shell is an interactive character based input/output surface.
  17. ^ Not available as a shell built-in. External FINDSTR /R command is available in most Windows releases.
  18. ^ PowerShell leverages the full .NET regular expression engine which features named captures, zero-width lookahead/-behind, greedy/non-greedy, character classes, level counting etc.
  19. ^ a b c d e f g h i j k xautomation and xdotool can be used to generate keystrokes under X Window System; or a program can be run in a pseudoterminal to be able to control it (as with the expect tool).
  20. ^ a b c d e f g h i The shell can use the stty utility to suppress echoing of typed characters to the screen. This requires multiple steps: 1. reading the current echo state, 2. switching echo off, 3. reading the input, 4. switching echo state back to the original state.
  21. ^ a b c d e f g h i j k l The execute permission is enforced by a separate program, the program loader, by refusing to invoke the interpreter (possibly a shell) specified by the script's hashbang. The interpreter does not enforce the execute permission if invoked directly as the program loader would, with the file as an argument; this only requires read permission, as does piping the file as input to the interpreter, in which case the interpreter cannot see the execute permission.
  22. ^ a b The zsh and fish shells also honor the execute permission for command completion.
  23. ^ a b Under DR-DOS the password separator for file and directory passwords is a semicolon. This is also supported under 4DOS for as long as the command does not support include lists. Under 4DOS, the password separator must be doubled for all commands supporting include lists in order to distinguish passwords from include lists. Commands not supporting include lists accept both forms. DR-DOS 7.02 and higher optionally accept a doubled semicolon as well, so that doubled semicolons work under both COMMAND.COM and 4DOS regardless of the command executed.
  24. ^ a b DR-DOS supports file passwords for read/write/delete and optionally execute permissions. Files are not protected by default, but the system can be set up so that f.e. batch scripts require a password to read.
  25. ^ a b INPUT /P and INKEY /P echoes back asterisks for each typed character.
  26. ^ Read-Host -AsSecureString reads a string of characters from the input device into an encrypted string, one character at a time thus ensuring that there is no memory image of the clear text which could be gleaned from scanning memory, or from crash dumps, memory dumps, paging files, log files or similar.
  27. ^ PowerShell script files (.ps1 files) are by default associated with the Notepad editor, not with the PowerShell execution engine. Invoking a .ps1 file will launch Notepad rather than executing the script.
  28. ^ Startup scripts per computer/user can import modules and expose a subset the commands/functions available in the modules.

References

[edit]
  1. ^ A platform independent version based on the historical UNIX V7 original source code is available from Geoff Collyer
  2. ^ The historic UNIX V7 version is available under a BSD-style license through The Unix Heritage Society and others.
  3. ^ A platform independent version based on the SVr4/Solaris source code is available from J?rg Schilling
  4. ^ Ferrell, John, "Chapter 2. Default Shell", FreeBSD Quickstart Guide for Linux Users, The FreeBSD Documentation Project, retrieved 2025-08-07
  5. ^ "SchilliX-ON / SchilliX-ON Mercurial / [b1d9a2] /usr/src/cmd/sh". Sourceforge.net. Retrieved 2025-08-07.
  6. ^ IEEE and The Open Group (2008). IEEE 1003.1 Standard for Information Technology – Portable Operating System Interface (POSIX): Shell and Utilities, Issue 7.
  7. ^ As part of IEEE Std.1003.2-1992 (POSIX.2); integrated into IEEE Std.1003.1 with the 2001 revision.
  8. ^ Fox, Brian (2025-08-07). Tower Jr., Leonard H. (ed.). "Bash is in beta release!". Newsgroupgnu.announce. Usenet: 8906080235.AA01983@wheat-chex.ai.mit.edu. Retrieved 2025-08-07.
  9. ^ Cooper, Mendel, "Chapter 37.3.2. Bash, version 4.2", Advanced Bash-Scripting Guide, The Linux Documentation Project, retrieved 2025-08-07, "Bash now supports the \u and \U Unicode escape."
  10. ^ Greer, Ken (2025-08-07). "C shell with command and filename recognition/completion". Newsgroupnet.sources. Retrieved 2025-08-07.
  11. ^ "FreeBSD Quickstart Guide for Linux? Users". FreeBSD Documentation Portal. Retrieved 2025-08-07.
  12. ^ Sussman, Ann (2025-08-07). "Hamilton C Shell Speeds Development Of OS/2 Applications" (PDF). PC Week (2025-08-07 - 2025-08-07): 37. Retrieved 2025-08-07.
  13. ^ Gomes, Ron (2025-08-07). "Toronto USENIX Conference Schedule (tentative)". Newsgroupnet.usenix. Retrieved 2025-08-07.
  14. ^ Harris, Guy (2025-08-07). "csh question". Newsgroupnet.flame. Retrieved 2025-08-07.
  15. ^ a b ksh93(1) man page
  16. ^ a b Default shell in OpenBSD is ksh (pdksh).
  17. ^ The zsh command line editor is fully configurable and can allow mouse support in various ways such as with Stéphane Chazelas's mouse.zsh.
  18. ^ zsh(1) man page and subpages
  19. ^ zshbuiltins(1) man page
  20. ^ Lefevre, Vincent (2025-08-07). "multi-digit file descriptors". zsh-users (Mailing list). Retrieved 2025-08-07.
  21. ^ "#782228 - busybox sh doesn't support multibyte characters in string handling - Debian Bug report logs". Bugs.debian.org. 2025-08-07. Retrieved 2025-08-07.
  22. ^ "HP OpenVMS DCL Dictionary". Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  23. ^ Larabel, Michael (2025-08-07). "Plan 9 Copyright Transferred To Foundation, MIT Licensed Code Released". Phoronix. Retrieved 2025-08-07.
  24. ^ Liljencrantz, Axel (2025-08-07). "Fish - The friendly interactive shell". Retrieved 2025-08-07.
  25. ^ Soller, Jeremy (2025-08-07). "d79c8f511573fb7710abc63b4236a40022914520". Retrieved 2025-08-07.
  26. ^ "[Z Shell] Completion System". Zsh.sourceforge.io. Retrieved 2025-08-07.
  27. ^ This applies only on reserved words and other syntactic features.
  28. ^ e.g. via 3rd party such as zsh-autosuggestions
  29. ^ zsh does not feature syntax highlighting, but a 3rd party project exists which offers this capability as an add-on: zsh-syntax-highlighting
  30. ^ Paul, Matthias R. (2025-08-07) [2025-08-07]. "Caldera OpenDOS 7.01/7.02 Update Alpha 3 IBMBIO.COM - README.TXT and BOOT.TXT - A short description of how OpenDOS is booted". Archived from the original on 2025-08-07. Retrieved 2025-08-07. [1]
  31. ^ a b c d e Shirk, Jason (2025-08-07). "PSReadLine: A bash inspired readline implementation for PowerShell" – via GitHub.
  32. ^ "Windows PowerShell 5.0". Archived from the original on 17 September 2016. Retrieved 8 September 2016.
  33. ^ a b c d e "Windows PowerShell Integrated Scripting Environment (ISE)". Microsoft Technet. Retrieved 2025-08-07.
  34. ^ "Get-ChildItemColor". GitHub. 2025-08-07.
  35. ^ sdwheeler. "Write-Host (Microsoft.PowerShell.Utility) - PowerShell". docs.microsoft.com. Retrieved 2025-08-07.
  36. ^ Push-Location (with alias pushd) and Pop-Location (with alias popd) allows multiple location types (directories of file systems, organizational units of Active Directory, nodes of Windows Registry etc) to be pushed onto and popped from location stacks.
  37. ^ The $host.ui.PromptForChoice function allows for a menu-style prompt for choices. The prompt works from background jobs as well as from remote sessions, displaying the menu prompt on the console of the controlling session.
  38. ^ The Write-Progress cmdlet writes a progress bar which can indicate percentage, remaining seconds etc. The progress bar messages work from background jobs or remote sessions in addition to interactive scripts, i.e. the progress bar is displayed on the console of the controlling session, not as part of the regular output.
  39. ^ The Show-Command cmdlet inspects the command definition and opens an interactive windows with a named input field for each parameter/switch
  40. ^ a b "fish: Documentation". Section Tab completion. Retrieved 2025-08-07.
  41. ^ "set_color - set the terminal color — fish-shell 3.1.2 documentation". fishshell.com. Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  42. ^ "abbr - manage fish abbreviations — fish-shell 3.1.2 documentation". fishshell.com. Retrieved 2025-08-07.
  43. ^ "zsh: 20. Completion System". Zsh.sourceforge.io. 2025-08-07. Retrieved 2025-08-07.
  44. ^ sdwheeler. "What's New in the PowerShell 5.0 ISE - PowerShell". docs.microsoft.com. Retrieved 2025-08-07.
  45. ^ "GitHub - marlonrichert/zsh-autocomplete: ?? Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion". GitHub. Retrieved 2025-08-07.
  46. ^ "Interactive use — fish-shell 3.3.1 documentation". fishshell.com. Retrieved 2025-08-07.
  47. ^ Hahn, Harley (2009). Harley Hahn's guide to Unix and Linux. Boston: McGraw-Hill Higher Education. ISBN 978-0-07-313361-4. OCLC 184828059.
  48. ^ Concurrent DOS 386 - Multiuser/Multitasking Operating System - User Guide (PDF). Digital Research.
  49. ^ "pv(1): monitor progress of data through pipe - Linux man page". Linux.die.net. Retrieved 2025-08-07.
  50. ^ "fish: Tutorial". fishshell.com. Retrieved 2025-08-07.
  51. ^ "zsh-users/zsh-syntax-highlighting: Fish shell like syntax highlighting for Zsh". GitHub. Retrieved 2025-08-07.
  52. ^ sdwheeler. "PSReadLine Module - PowerShell". learn.microsoft.com. Retrieved 2025-08-07.
  53. ^ Introduce 'function' built-in by Matheus Garcia
  54. ^ "Ash Variants". Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  55. ^ "Set - Environment Variable - Windows CMD". SS64.com. Retrieved 2025-08-07.
  56. ^ "How to loop through array in batch?". Stack Overflow. Retrieved 2025-08-07.
  57. ^ The .NET System.Math class defines mathematical functions that can be used through the shortcut [Math], e.g. [Math]::Sin for the sinus function.[2]
  58. ^ "Get closure with GetNewClosure". devblogs.microsoft.com. 2025-08-07. Retrieved 2025-08-07.
  59. ^ "string - manipulate strings — fish-shell 3.1.2 documentation". fishshell.com. Retrieved 2025-08-07.
  60. ^ Hamilton C shell Language reference: Wildcarding and pattern matching, Hamilton Laboratories, retrieved 2025-08-07, ... Indefinite Directory: match any number of directory levels – zero or more – whatever it takes to make the rest of the pattern match.
  61. ^ a b Seebach, Peter (2025-08-07). Beginning Portable Shell Scripting: From Novice to Professional. Expert's voice in open source. Apress (published 2008). p. 149. ISBN 9781430210436. Retrieved 2025-08-07. Brace expansion is available in ksh93, pdksh, bash, and zsh.
  62. ^ Zsh offers a variety of globbing options.
  63. ^ sdwheeler. "about Operators - PowerShell". docs.microsoft.com. Retrieved 2025-08-07.
  64. ^ Brothers, Hardin; Rawson, Tom; Conn, Rex C.; Paul, Matthias R.; Dye, Charles E.; Georgiev, Luchezar I. (2025-08-07). 4DOS 8.00 online help.
  65. ^ "find a way to make 'psub --fifo' safe from deadlock · Issue #1040 · fish-shell/fish-shell". GitHub.
  66. ^ "About Data Sections". Technet.microsoft.com. Retrieved 2025-08-07.
  67. ^ "Ubuntu Manpage: rc - shell". Manpages.ubuntu.com. 2025-08-07. Retrieved 2025-08-07.
  68. ^ Provos, Niels. "Encrypting Virtual Memory". Center for Information Technology Integration, University of Michigan. Retrieved 2025-08-07.
  69. ^ "bash - GNU Bourne-Again SHell". read -s Silent mode. If input is coming from a terminal, characters are not echoed.
  70. ^ "Using the Read-Host Cmdlet". By adding the -assecurestring parameter you can mask the data entered at the prompt
  71. ^ "Linux / Unix Command: stty". Linux.about.com. Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  72. ^ "man sh - shell, the standard command language interpreter / posix" (in French). Pwet.fr. Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  73. ^ "Bash Reference Manual: The Restricted Shell". Gnu.org. 2025-08-07. Retrieved 2025-08-07.
  74. ^ "New-PSSessionConfigurationFile". Technet.microsoft.com. Retrieved 2025-08-07.
  75. ^ Albing, Carl; Vossen, J. P.; Newham, Cameron (2007). Bash cookbook (1st ed.). Sebastopol, California, USA: O'Reilly Media. ISBN 978-0-596-52678-8. [...] is hardly what one thinks of as a passive list of configured variables. It can run other commands (e.g., cat) and use if statements to vary its choices. It even ends by echoing a message. Be careful when you source something, as it's a wide open door into your script.
[edit]
小孩子记忆力差是什么原因 低盐饮食有利于预防什么疾病 别出心裁的裁是什么意思 冲羊煞东是什么意思 宝宝胀气是什么原因引起的
牙龈肿是什么原因 life style是什么品牌 牙龈出血吃什么药 巴甫洛夫的狗比喻什么 脂肪肝要注意什么
小钙化灶是什么意思 胆汁酸是什么 伤到骨头吃什么好得快 人活着意义是什么 手冲是什么
去香港买什么划算 西红柿和什么不能一起吃 狗鼻子干是什么原因 农历今天属什么生肖 天然气什么味道
古代新疆叫什么hcv8jop0ns6r.cn 莲花与荷花有什么区别hcv8jop4ns4r.cn 淋巴结什么原因引起的jiuxinfghf.com 硬性要求是什么意思hcv9jop1ns9r.cn 一个大一个小念什么hcv8jop9ns8r.cn
针眼用什么眼药水hcv9jop1ns8r.cn 男人更年期有什么症状有哪些表现hcv8jop3ns9r.cn 郝字五行属什么zsyouku.com 菜籽油是什么菜籽做的hcv9jop6ns0r.cn 孩子为什么有胎记onlinewuye.com
什么神什么注hcv8jop6ns3r.cn 破伤风感染后会出现什么症状hcv9jop6ns6r.cn 器质性心脏病是什么意思hcv7jop7ns0r.cn 不惑之年什么意思sanhestory.com 鸡蛋和什么不能一起吃jasonfriends.com
2021属什么hcv9jop4ns8r.cn hbcab偏高是什么意思hcv8jop2ns8r.cn 适当是什么意思hcv8jop9ns0r.cn 什么是记忆棉hcv9jop5ns8r.cn HlV是什么hcv8jop2ns7r.cn
百度