苯磺酸氨氯地平片是什么药| 拔萝卜是什么意思| 血糖高有什么表现| 毓字五行属什么| 火影忍者大结局是什么| 破釜沉舟是什么意思| 身份证最后一位代表什么| 月经来黑色是什么原因| 人参果不能和什么一起吃| ki67是什么意思| 阳虚吃什么中成药| 拐子是什么鱼| 顶胯是什么意思| 生理期量少是什么原因| 什么样的大便是正常的| 富是什么生肖| 司马光和司马迁是什么关系| 黑苦荞茶适合什么人喝| 骨折补钙吃什么钙片好| 五十知天命什么意思| 亟待解决什么意思| 男人下面出汗是什么原因| 血压低吃什么| 跳楼机是什么| 铎读什么| 江西有什么好玩的景点| 夏令时什么意思| 内心丰盈是什么意思| 黄历中的入宅是什么意思| 脂溢性皮炎用什么药| 胡子长的快是什么原因| 什么是交感神经| a型血可以接受什么血型| 生津是什么意思| 白细胞高是什么原因造成的| 碱性磷酸酶偏高吃什么能降下来呢| 心存芥蒂是什么意思| 什么地流着| 三高可以吃什么水果| 尿酸降低是什么意思| 双侧下鼻甲肥大是什么意思| 急性肠胃炎能吃什么水果| 背部毛孔粗大是什么原因| 小暑吃什么| 急性肠胃炎可以吃什么食物| 向日葵代表什么意思| 什么叫腺样体肥大| 省政协常委是什么级别| 8月是什么季节| 斗破苍穹什么时候出的| 静对什么| 六个口是什么字| 鹰头皮带是什么牌子| 臭鱼烂虾什么意思| 吃什么水果可以减肥| 梦见生女孩是什么征兆| 紫得什么| 左侧卵巢囊性包块是什么意思| 白左什么意思| 耳声发射检查是什么| 叶什么什么龙| 保释是什么意思| 吃苦瓜有什么好处| 火鸡是什么鸡| ygk是什么牌子| 如你所愿是什么意思| 侍寝是什么意思| 眼睛痒流泪是什么原因| 过敏吃什么药| 乙状结肠管状腺瘤是什么意思| 不期而遇什么意思| 儿童口腔溃疡吃什么药| 12月10号是什么星座| 黑茶属于什么茶| 减肥期间早餐应该吃什么| 优柔寡断是什么意思| 月经提前10天正常吗是什么原因| 什么药降糖效果最好| 哮喘病有什么症状| 月经量少吃什么| 豆芽炒什么好吃| 什么食物含胶原蛋白最多| 崩漏带下是什么症状| 氟康唑治什么妇科炎症| 鱼吐泡泡是什么原因| 梦到甘蔗代表什么预兆| 血常规是什么意思| 粉领是什么意思| 什么是阳虚| 芹菜炒什么| 风寒感冒吃什么药效果好| hoegaarden是什么啤酒| 脑血管堵塞吃什么药好| 什么是腰肌劳损| cosplay什么意思| 肋骨疼挂什么科| 螺旋ct检查什么| 什么是有氧运动什么是无氧运动| 亿后面是什么单位| 什么叫脑梗| fbi相当于中国的什么| 右耳朵耳鸣是什么原因| 心电图逆钟向转位是什么意思| 孙策是孙权的什么人| 小老头是什么意思| 祸不及家人前一句是什么| 有过之而不及什么意思| 南乳和腐乳有什么区别| 昆虫记是什么类型的书| 生肠是什么| 文曲星什么意思| 小叶紫檀五行属什么| 性张力什么意思| 托帕石是什么| 半边屁股疼是什么原因| 月经突然停止是什么原因| 什么什么不同| 偏头疼是什么原因引起| 查传染病四项挂什么科| 五月十八什么星座| 天秤座什么性格| 硬卧代硬座是什么意思| 欧阳修字什么| 摊手是什么意思| 白酒兑什么好喝| m是什么意思| 六月十二日是什么日子| 为什么会突然头晕| 孕期吃什么好| 膝盖肿是什么原因| yjs是什么意思| 脚肿什么原因引起的| 陈醋与香醋有什么区别| 1974年属什么生肖| 无缘无故流鼻血是什么原因| 童子是什么意思| 梦见狼狗是什么预兆| 乳腺腺体是什么| 广州有什么小吃特产| 吃毓婷有什么副作用| 冷冻跟冷藏有什么区别| 什么蛇最厉害| 真空是什么意思| 痉挛吃什么药效果好| 篮子房是什么意思| 在什么情况下需要做肠镜| 着凉感冒吃什么药| 心智不成熟是什么意思| 栀子有什么作用与功效| 胃复安是什么药| silk是什么意思| 尿酸高的人吃什么食物好| 电镀是做什么的| 流产后不能吃什么东西| nt是什么货币| 人间仙境是什么意思| 紧急避孕药吃了有什么副作用| 造纸术什么时候发明的| 麻疹是什么| 色织布是什么面料| 偏头痛什么原因引起| 试营业是什么意思| 温水煮青蛙是什么意思| 男人都是大猪蹄子是什么意思| 可乐饼为什么叫可乐饼| 腹部叩诊什么音正常| 慢性非萎缩性胃炎伴糜烂是什么意思| 血小板体积偏低是什么原因| 低俗是什么意思| 肾虚是什么原因造成的| 落是什么生肖| 风雨交加是什么生肖| 孟买血型是什么意思| 7月16是什么星座| 县人武部政委什么级别| 拔牙什么时间最好| 室性期前收缩是什么病| 上火耳鸣吃什么药最好| 士加一笔是什么字| 区长是什么级别| 女性看乳房应该挂什么科| 为什么月经迟迟不来又没怀孕| 黄河里有什么鱼| 霉菌性阴道炎是什么原因引起的| 肺部疼痛什么原因| 什么时候种胡萝卜最好| 补办港澳通行证需要什么材料| 篱笆是什么| 12年属什么生肖| 冬虫夏草生长在什么地方| 什么有所什么| 霉菌感染男性什么症状| 白球比低是什么原因| 卖酒需要办理什么证| 尿葡萄糖高是什么原因| 姜不能和什么一起吃| 什么来什么去| 嘴角起泡用什么药膏好| 艾滋有什么症状| 长歌怀采薇是什么意思| 什么样的人不适合吃人参| 口干口苦是什么病| 请多指教是什么意思| 1946年属狗的是什么命| 猫和狗为什么是天敌| 文房四宝是什么| diamond是什么牌子| 10.1什么星座| 尿道口有烧灼感为什么| 头晕用什么药| 右脸长痘是什么原因| aone是什么牌子| 献血前吃什么东西最好| 没主见是什么意思| 心脏在人体什么位置| 开天眼是什么意思| 不小心怀孕了吃什么药可以流掉| 人为什么不可以偏食| 尿有臭味是什么原因| 总是拉肚子是什么原因| 尿蛋白是什么| 肾功能不好吃什么药| 粤语点解什么意思| 贡菜是什么菜做的| 父母什么血型会溶血| 小狗呕吐吃什么药| 小金蛙吃什么| 宋江是一个什么样的人| 金兰之交是什么意思| 黄水疮用什么药膏最快| 胆小怕事是什么生肖| bp在医学上是什么意思| 比重是什么| 灵性是什么意思| 不全性骨折是什么意思| 鬼谷子姓什么| 致五行属什么| 防晒霜和隔离霜有什么区别| 为什么要文化大革命| 归元寺求什么最灵验| 什么东西补钾| 一月三日是什么星座| 泌尿感染吃什么药最好| 吃什么最养胃| 眼睛淤青用什么方法能快点消除| 幽门螺杆菌是什么引起的| choker什么意思| 消化不好吃什么药最好| 人间烟火什么意思| 供血不足吃什么药效果最好| 偏财代表什么| o是什么| jerry英文名什么意思| 河南古代叫什么| 亨特综合症是什么病| 什么治胃胀气| 牙齿为什么会掉| 凌志和雷克萨斯有什么区别| 经常头晕吃什么食物好| 腋下臭是什么原因| 返酸水吃什么药| 月经一直不干净是什么原因| 复方甘草酸苷片治什么病| 梦见碗是什么意思| 百度

网购童装质量堪忧谁之过

(Redirected from Unix Shell)
百度 8848钛金手机今年参加巴塞尔钟表展将带来哪些新的惊喜?8848今年其实我们跟去年相比有两个比较大的事件,一个是我们这次带来了全新的和AHCI合作设计的巴塞尔的纪念款,我们有一个新的设计有两个版本的手机,另外我们这次也跟AHCI瑞士的独立制表人协会签约。

A Unix shell is a shell that provides a command-line user interface for a Unix-like operating system. A Unix shell provides a command language that can be used either interactively or for writing a shell script.[2] A user typically interacts with a Unix shell via a terminal emulator; however, direct access via serial hardware connections or Secure Shell are common for server systems. Although use of a Unix shell is popular with some users, others prefer to use a windowing system such as desktop Linux distribution or macOS instead of a command-line interface.

tcsh and sh shell windows on a Mac OS X Leopard[1] desktop

A user may have access to multiple Unix shells with one configured to run by default when the user logs in interactively. The default selection is typically stored in a user's profile; for example, in the local passwd file or in a distributed configuration system such as NIS or LDAP. A user may use other shells nested inside the default shell.

A Unix shell may provide many features including: variable definition and substitution, command substitution, filename wildcarding, stream piping, control flow structures (condition-testing and iteration), working directory context, and here document.

Early shells

edit

The first Unix shell was the Thompson shell, sh, written by Ken Thompson at Bell Labs and distributed with Versions 1 through 6 of Unix, from 1971 to 1975.[3] Though rudimentary by modern standards, it introduced many of the basic features common to all later Unix shells, including piping, simple control structures using if and goto, and filename wildcarding. Though not in current use, it is still available as part of some Ancient UNIX systems.

It was modeled after the Multics shell, developed in 1965 by American software engineer Glenda Schroeder. Schroeder's Multics shell was itself modeled after the RUNCOM program Louis Pouzin showed to the Multics Team. The "rc" suffix on some Unix configuration files (e.g. ".bashrc" or ".vimrc"), is a remnant of the RUNCOM ancestry of Unix shells.[1][4]

The PWB shell or Mashey shell, sh, was an upward-compatible version of the Thompson shell, augmented by John Mashey and others and distributed with the Programmer's Workbench UNIX, circa 1975–1977. It focused on making shell programming practical, especially in large shared computing centers. It added shell variables (precursors of environment variables, including the search path mechanism that evolved into $PATH), user-executable shell scripts, and interrupt-handling. Control structures were extended from if/goto to if/then/else/endif, switch/breaksw/endsw, and while/end/break/continue. As shell programming became widespread, these external commands were incorporated into the shell itself for performance.

But the most widely distributed and influential of the early Unix shells were the Bourne shell and the C shell. Both shells have been used as the coding base and model for many derivative and work-alike shells with extended feature sets.[5]

Bourne shell

edit

The Bourne shell, sh, was a new Unix shell by Stephen Bourne at Bell Labs.[6] Distributed as the shell for UNIX Version 7 in 1979, it introduced the rest of the basic features considered common to all the later Unix shells, including here documents, command substitution, more generic variables and more extensive builtin control structures. The language, including the use of a reversed keyword to mark the end of a block, was influenced by ALGOL 68.[7] Traditionally, the Bourne shell program name is sh and its path in the Unix file system hierarchy is /bin/sh. But a number of compatible work-alikes are also available with various improvements and additional features. On many systems, sh may be a symbolic link or hard link to one of these alternatives:

The POSIX standard specifies its standard shell as a strict subset of the Korn shell, an enhanced version of the Bourne shell. From a user's perspective the Bourne shell was immediately recognized when active by its characteristic default command line prompt character, the dollar sign ($).

C shell

edit

The C shell, csh, was modeled on the C programming language, including the control structures and the expression grammar. It was written by Bill Joy as a graduate student at University of California, Berkeley, and was widely distributed with BSD Unix.[9][better?source?needed]

The C shell also introduced many features for interactive work, including the history and editing mechanisms, aliases, directory stacks, tilde notation, cdpath, job control and path hashing. On many systems, csh may be a symbolic link or hard link to TENEX C shell (tcsh), an improved version of Joy's original version. Although the interactive features of csh have been copied to most other shells, the language structure has not been widely copied. The only work-alike is Hamilton C shell, written by Nicole Hamilton, first distributed on OS/2 in 1988 and on Windows since 1992.[10]

Configuration files

edit

Shells read configuration files in various circumstances. These files usually contain commands for the shell and are executed when loaded; they are usually used to set important variables used to find executables, like $PATH, and others that control the behavior and appearance of the shell. The table in this section shows the configuration files for popular shells.[11]

Configuration file sh ksh csh tcsh bash zsh
/etc/.login login login
/etc/csh.cshrc yes yes
/etc/csh.login login login
~/.tcshrc yes
~/.cshrc yes yes[a]
/etc/ksh.kshrc int.
/etc/sh.shrc int.[b]
$ENV (typically ~/.kshrc)[12] int.[c][d] int. int.[e]
~/.login login login
~/.logout login login
/etc/profile login login login login[f]
~/.profile login login login[g] login[f]
~/.bash_profile login[g]
~/.bash_login login[g]
~/.bash_logout login
~/.bashrc int.+n/login
/etc/zshenv yes
/etc/zprofile login
/etc/zshrc int.
/etc/zlogin login
/etc/zlogout login
~/.zshenv yes
~/.zprofile login
~/.zshrc int.
~/.zlogin login
~/.zlogout login

Explanation:

  • blank means a file is not read by a shell at all.
  • "yes" means a file is always read by a shell upon startup.
  • "login" means a file is read if the shell is a login shell.
  • "n/login" means a file is read if the shell is not a login shell.
  • "int." means a file is read if the shell is interactive.
  1. ^ only if ~/.tcshrc not found
  2. ^ Newer versions of the Bourne Shell only
  3. ^ Available on systems that support the "User Portability Utilities option"; value of the variable must be an absolute path, and it is ignored "if the user's real and effective user IDs or real and effective group IDs are different."[13]
  4. ^ $ENV is $HOME/.shrc in newer versions of the Bourne Shell
  5. ^ Same behavior as sh, but only if invoked as sh (bash 2+) or, since bash 4.2, also if invoked explicitly in POSIX compatibility mode (with options --posix or -o posix).[14]
  6. ^ a b Only in sh/ksh compatibility mode (when invoked as bash, sh, ksh)
  7. ^ a b c The first readable file in order of ~/.bash_profile, ~/.bash_login and ~/.profile; and only ~/.profile if invoked as sh or, as of at least Bash 4.2, if invoked explicitly in POSIX compatibility mode (with options --posix or -o posix)

Other shells

edit

Variations on the Unix shell concept that don't derive from Bourne shell or C shell include the following:[15]

See also

edit

References

edit
  1. ^ a b Tom Van Vleck (2025-08-14). "Unix and Multics". Multicians.org. Retrieved 2025-08-14.
  2. ^ Bourne, Stephen R. (October 1983). "The Unix Shell". BYTE. p.?187. Retrieved 30 January 2015.
  3. ^ "V6 Thompson Shell Port - History". V6shell.org. Retrieved 2025-08-14.
  4. ^ Louis Pouzin (2025-08-14). "The Origin of the Shell". Multicians.org. Retrieved 2025-08-14.
  5. ^ Nikolai Bezroukov (2025-08-14). "Introduction to the Unix shell history". Softpanorama. Archived from the original on 2025-08-14. Retrieved 2025-08-14.
  6. ^ Bourne, Stephen (2025-08-14). "The A-Z of Programming Languages: Bourne shell, or sh" (Interview). Interviewed by Howard Dahdah. Computerworld. Retrieved 2025-08-14.
  7. ^ "Re: Late Bloomers Revisited". Retrieved 20 September 2014.
  8. ^ Korn, David G. (October 26, 1994), "ksh - An Extensible High Level Language", Proceedings of the USENIX 1994 Very High Level Languages Symposium, USENIX Association, retrieved February 5, 2015, Instead of inventing a new script language, we built a form entry system by modifying the Bourne shell, adding built-in commands as necessary.
  9. ^ Harley Hahn, Harley Hahn's Guide to Unix and Linux: Unix/Linux Timeline.
  10. ^ "Hamilton C shell for Windows Release Notes 4.0". Retrieved 20 September 2014.
  11. ^ "Different UNIX Shells". unixnote.com. 2010. Archived from the original on 2025-08-14. Retrieved 2025-08-14.
  12. ^ SCO Unix Group, SCO Unixware 7 documentation, 22 Apr 2004, retrieved 18 Oct 2012 Archived 24 August 2019 at the Wayback Machine.
  13. ^ "Shell Command Language". opengroup.org. Retrieved 15 June 2015.
  14. ^ "Bash Reference Manual: Bash Startup Files". gnu.org. Retrieved 15 June 2015.
  15. ^ "FreeBSD Ports: Shells". Freebsd.org. 2025-08-14. Archived from the original on 2025-08-14. Retrieved 2025-08-14.
想什么来什么是什么定律 云服务是什么 眼睛干涩疲劳用什么眼药水 风寒水饮是什么意思 小孩嘴唇发白是什么原因
回民不吃什么 宇舶手表什么档次 皮肤镜能检查出什么 办结婚证需要什么 吃的少还胖什么原因
正品行货是什么意思 什么是理学 1901年属什么生肖 手术后发烧是什么原因 抹茶是什么茶
字母圈是什么意思 蓝牙耳机什么样的好 老年痴呆症挂什么科 新生儿五行缺什么查询 血红蛋白低吃什么可以补起来
口里有异味是什么原因hcv7jop7ns4r.cn 检查肺结节挂什么科weuuu.com 肛门瘙痒用什么药最好hanqikai.com 起大运是什么意思zhongyiyatai.com 鱼腥草治什么病hcv8jop6ns5r.cn
一泻千里是什么意思hcv9jop2ns1r.cn 九月十号是什么星座hcv9jop5ns9r.cn 营救是什么意思hcv8jop7ns7r.cn 158是什么意思sscsqa.com 二甲苯是什么东西hcv8jop7ns3r.cn
朱允炆为什么不杀朱棣hcv8jop4ns7r.cn 肺部微结节是什么意思hcv8jop8ns9r.cn 感染幽门螺杆菌吃什么药hcv7jop5ns5r.cn 知了为什么叫hcv9jop4ns3r.cn 磷脂是什么hcv8jop9ns5r.cn
支气管炎吃什么药好得快hcv9jop2ns5r.cn 什么是炎症hcv8jop2ns0r.cn 总是低烧是什么原因造成的hcv7jop5ns5r.cn 怀孕几天后有什么反应hcv9jop3ns4r.cn 女人八卦是什么意思hcv8jop5ns0r.cn
百度