[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-689100-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-689100-en":130,"doc-similar-689100":269},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","principia-softwarica-the-plan-9-shell-rc-version-10-technical-documentation","Principia Softwarica: The Plan 9 Shell rc - version 1.0 - technical documentation","","Principia Softwarica: The Plan 9 Shell rc presents version 1.0 documentation for the Plan 9 rc shell, covering motivations and shell fundamentals as a command interpreter and scripting language. It explains core principles such as running commands, redirections, pipes, globbing, quoting and escaping, interactive execution, and asynchronous behavior. The text then details rc’s command-line interface and boot process, followed by in-depth design and implementation topics including data structures, parsing, lexing, and the bytecode interpreter loop.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/principia-softwarica-the-plan-9-shell-rc-version-10-technical-documentation/689100/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/principia-softwarica-the-plan-9-shell-rc-version-10-technical-documentation/689100.png","ImageObject",300,407,{"name":42,"@type":43},"naya.afterrain","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-29","2026-11-08",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",5,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"What does the document cover about the Plan 9 rc shell?","Question",{"text":63,"@type":64},"It covers rc shell motivations and core principles such as command execution, redirections, pipes, globbing, quoting/escaping, interactive interpretation, and asynchronous execution. It also introduces the rc command-line interface and boot-time initialization.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How are commands and scripts structured in the rc shell?",{"text":68,"@type":64},"The document explains how commands are combined (including sequences and pipes), how scripts store and execute sequences of words, and how the shell can act as a scripting language. It further covers interactive behavior and execution control.",{"name":70,"@type":61,"acceptedAnswer":71},"What implementation internals are described for rc?",{"text":72,"@type":64},"It details core data structures like tokens, abstract syntax trees, bytecode/code buffers, threads/run queues, and word lists. It also discusses the main interpreter loop, along with lexing and parsing components.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},689100,1794096301,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":55,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":80,"read_time":144,"preview_page_count":145,"preview_urls":146},962094248482,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","Principia Softwarica: The Plan 9 Shell rc  \nversion 1.0  \nYoann Padioleau  \n[yoann. padioleau@gmail. com](yoann. padioleau@gmail. com)  \nwith code from  \nTom Duff  \nJune 17, 2026  \nThe text and figures are Copyright ➞ 2014–2026 Yoann Padioleau. All rights reserved.  \nThe source code is Copyright ➞ 2021 Plan 9 Foundation.  \nMIT license.  \nContents  \n1 Introduction 8  \n1.1 Motivations ............................................... 8  \n1.2 The Plan 9 shell: rc .......................................... 9  \n1.3 Other shells ............................................... 9  \n1.4 Getting started ............................................. 10  \n1.5 Requirements .............................................. 12  \n1.6 About this document .......................................... 13  \n1.7 Copyright ................................................ 13  \n1.8 Acknowledgments ............................................ 13  \n2 Overview 14  \n2.1 Shell principles and features ...................................... 14  \n2.1.1 Shell versus terminal ...................................... 14  \n2.1.2 Running commands ....................................... 14  \n2.1.3 Redirections ........................................... 16  \n2.1.4 Combining commands: the pipe ................................ 16  \n2.1.5 Storing commands in a script ................................. 17  \n2.1.6 A shell as a scripting language ................................. 18  \n2.1.7 Globbing ............................................. 19  \n2.1.8 Quoting and escaping ...................................... 19  \n2.1.9 An interactive interpreter ................................... 20  \n2.1.10 Asynchronous execution .................................... 20  \n2.1.11 The CLI renaissance ...................................... 20  \n2.2 rc command-line interface ....................................... 21  \n2.3 boot . rc ................................................. 21  \n2.3.1 Comments ............................................ 22  \n2.3.2 Initialization script: rcmain .................................. 22  \n2.3.3 Variables and list of strings .................................. 22  \n2.3.4 $path .............................................. 22  \n2.3.5 Quoting ............................................. 23  \n2.3.6 The environment ........................................ 23  \n2.3.7 Builtins ............................................. 23  \n2.3.8 Other features .......................................... 23  \n2.4 Code organization ............................................ 24  \n2.5 Software architecture .......................................... 25  \n2.5.1 The command-line user interface ............................... 25  \n2.5.2 rc’s components ........................................ 25  \n2.5.3 Trace of a simple command: ls / ............................... 28  \n2.6 Book structure ............................................. 29  \n3 Core Data Structures 30  \n3.1 Token .................................................. 30  \n3.2 Abstract syntax Tree .......................................... 31  \n3.3 ByteCode and codebuf ......................................... 33  \n3.4 Thread and runqeue .......................................... 34  \n3.5 Words and lists of words ........................................ 36  \n3.5.1 Words .............................................. 36  \n3.5.2 List of sequence of words ................................... 38  \n3.6 Variables ................................................. 38  \n3.7 Putting it together: the data structures of hello . rc ........................ 40  \n4 main() 42  \n4.1 main() skeleton ............................................. 42  \n4.2 Command-line arguments processing ................................. 42  \n4.2.1 Login mode: rc-l ....................................... 43  \n4.2.2 Interactive mode: rc-i .................................... 43  \n4.3 Initialization ............................................... 44  \n4.4 Bootstr","cbCaia3QvEUkaFqe","https://ap.wps.com/l/cbCaia3QvEUkaFqe","pdf",1005331,269,"English","# Introduction\n## Motivations\n## The Plan 9 shell: rc\n## Getting started\n## Requirements\n## About this document\n## Copyright\n## Acknowledgments\n# Overview\n## Shell principles and features\n## rc command-line interface\n## boot . rc\n## Code organization\n## Software architecture\n## Book structure\n# Core Data Structures\n## Token\n## Abstract syntax Tree\n## ByteCode and codebuf\n## Thread and runqeue\n## Words and lists of words\n## Variables\n## Putting it together: the data structures of hello . rc\n# main()\n## main() skeleton\n## Command-line arguments processing\n## Initialization\n## Bootstrapping bytecodes (simplified)\n## Setting runq\n## Setting runq->argv\n## Bytecode interpreter loop\n## Reading commands: Xrdcmds()\n# Input\n## Overview\n## Reading a character: getnext()\n## Looking ahead: nextc() and advance()\n# Lexing\n## yylex()\n## Spaces and comments ('#')\n## Newlines\n## Quoted strings ('... ')\n## Operators ('&', '&&', ' | ', ' || ', '\u003C', '>', '$', ...)\n## Remaining non-word characters\n## Keywords and identifiers (if, for, while, switch, fn, ...)\n## Array subscript (\u003Carr>(\u003Cn>))\n# Parsing\n## Overview\n## Simple commands (\u003Ccmd> \u003Carg1> ...\u003Cargn>)\n## Operators\n## Sequences (';', '&')\n## Logical operators ('&&', ' || ', '!')\n## String matching ('~')\n## Pipe (' | ')\n## Redirections ('>', '\u003C'","[{\"question\":\"What does the document cover about the Plan 9 rc shell?\",\"answer\":\"It covers rc shell motivations and core principles such as command execution, redirections, pipes, globbing, quoting/escaping, interactive interpretation, and asynchronous execution. It also introduces the rc command-line interface and boot-time initialization.\"},{\"question\":\"How are commands and scripts structured in the rc shell?\",\"answer\":\"The document explains how commands are combined (including sequences and pipes), how scripts store and execute sequences of words, and how the shell can act as a scripting language. It further covers interactive behavior and execution control.\"},{\"question\":\"What implementation internals are described for rc?\",\"answer\":\"It details core data structures like tokens, abstract syntax trees, bytecode/code buffers, threads/run queues, and word lists. It also discusses the main interpreter loop, along with lexing and parsing components.\"}]","Principia Softwarica: The Plan 9 Shell rc - version 1.0 - technical documentation | PDF",678,27,[147,151,155,159,163,167,171,175,179,183,187,192,197,202,207,212,217,222,227,231,235,240,245,250,255,260,265],{"page_no":22,"url":148,"width":149,"height":150},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/e7a7f5d7f04b409dbcaeadf4660c023a.webp",983,1272,{"page_no":26,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/5f3be306fd37f4f9b4baf0ea5288bcd5.webp",982,1270,{"page_no":30,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/0eaa07621af3829843968fad848e11c0.webp",981,1269,{"page_no":33,"url":160,"width":161,"height":162},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/2cf3a567e72752c83f367e0be4af4f0f.webp",980,1268,{"page_no":55,"url":164,"width":165,"height":166},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/01ee6a90d6324c7abf24827b596f5965.webp",979,1267,{"page_no":101,"url":168,"width":169,"height":170},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/637f29f8f63b6d4281e7b0bc7ad7a40f.webp",978,1265,{"page_no":105,"url":172,"width":173,"height":174},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/59af26d191681ce7049272611234cc09.webp",977,1264,{"page_no":110,"url":176,"width":177,"height":178},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/c08412d954cf82e0dd1f80879b03ba43.webp",976,1263,{"page_no":115,"url":180,"width":181,"height":182},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/9bfc0fee48fb67010b0c006050afcacf.webp",975,1261,{"page_no":123,"url":184,"width":185,"height":186},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/a4500cfda0ab398f6bd54b24286ffdc4.webp",974,1260,{"page_no":188,"url":189,"width":190,"height":191},11,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/c270e200b3a60e8f2b06a9468c2ee514.webp",973,1259,{"page_no":193,"url":194,"width":195,"height":196},12,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/1f93d2b77b008a4f0a6e0c9b9ed8f68d.webp",972,1257,{"page_no":198,"url":199,"width":200,"height":201},13,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/a448c74345136397507a782e7e4acddb.webp",971,1256,{"page_no":203,"url":204,"width":205,"height":206},14,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/895d2dbcdfa25204550a21549fc0c880.webp",970,1255,{"page_no":208,"url":209,"width":210,"height":211},15,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/add381db5b6227363166ed67c3be65b7.webp",969,1254,{"page_no":213,"url":214,"width":215,"height":216},16,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/5c3aefd551c30d21aa1c0cb65da47d73.webp",968,1252,{"page_no":218,"url":219,"width":220,"height":221},17,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/be92d18978d7057f10906a0875892b6b.webp",967,1251,{"page_no":223,"url":224,"width":225,"height":226},18,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/90dfb9fd0623985a6541bf0f98c17313.webp",966,1250,{"page_no":127,"url":228,"width":229,"height":230},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/e121da2952b90806894b361350c5d14a.webp",965,1248,{"page_no":117,"url":232,"width":233,"height":234},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/5ec921026fd2b44235b69801c1d88ad1.webp",964,1247,{"page_no":236,"url":237,"width":238,"height":239},21,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/755ebaa39a5c39deaa2c5d73f7c29feb.webp",963,1246,{"page_no":241,"url":242,"width":243,"height":244},22,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/6fb761b641a94074f8ddf24bb51c9f23.webp",962,1245,{"page_no":246,"url":247,"width":248,"height":249},23,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/272a18c19772d71a48e931b26a80a01c.webp",961,1243,{"page_no":251,"url":252,"width":253,"height":254},24,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/f7b17a326a997627ef0858e7a9057b43.webp",960,1242,{"page_no":256,"url":257,"width":258,"height":259},25,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/6b0523d1a64aa2e17a8dff0b6ee63084.webp",959,1241,{"page_no":261,"url":262,"width":263,"height":264},26,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/1e2ec5ae612c234abab183c7a765466c.webp",958,1239,{"page_no":145,"url":266,"width":267,"height":268},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/97f8c72b22a726080e4a326dab083342.webp",957,1238,{"list":270,"token":11},[271,277,283,289,295,302,308,315,321,327],{"doc_id":272,"doc_title":273,"file_type":137,"home_preview_img_url":274,"slug":275,"view_count":33,"category_name":29,"create_tm":276},699572,"An Introduction to the Linux Command Shell - For Beginners - A GNU Free Documentation License Manual","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011312375/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=kkVCD9rg1p%2BQHvaA7sU%2FFtiQL%2FY%3D","an-introduction-to-the-linux-command-shell-for-beginners-a-gnu-free-documentation-license-manual",1794479414,{"doc_id":278,"doc_title":279,"file_type":137,"home_preview_img_url":280,"slug":281,"view_count":198,"category_name":29,"create_tm":282},671807,"A Practical Guide to Linux Commands - Editors and Shell Programming - Third Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988776589/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=753iul4CYhqve7IJgoaTxxyvYi4%3D","a-practical-guide-to-linux-commands-editors-and-shell-programming-third-edition",1793580874,{"doc_id":284,"doc_title":285,"file_type":137,"home_preview_img_url":286,"slug":287,"view_count":105,"category_name":29,"create_tm":288},699571,"BashGuide - About This Guide - Understanding Bash","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010750079/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=80esGJN09RMXa0S6FIGtpUtP2Qc%3D","bashguide-about-this-guide-understanding-bash",1794479404,{"doc_id":290,"doc_title":291,"file_type":137,"home_preview_img_url":292,"slug":293,"view_count":30,"category_name":29,"create_tm":294},689514,"Beginning Shell Scripting","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001332523/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=OHTBp7dZJ59cHjcbdocmWIA5YUs%3D","beginning-shell-scripting",1794112221,{"doc_id":296,"doc_title":297,"file_type":137,"home_preview_img_url":298,"slug":299,"view_count":300,"category_name":29,"create_tm":301},117655,"Best of Bash 2026 Edition - Unsung Tools for the Shell - Going Deeper","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229834701874/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=S3B58JMoy0g909iSvz3GfhgxKIc%3D","best-of-bash-2026-edition-unsung-tools-for-the-shell-going-deeper",38,1785678010,{"doc_id":303,"doc_title":304,"file_type":137,"home_preview_img_url":305,"slug":306,"view_count":22,"category_name":29,"create_tm":307},759877,"Building Your Mouseless Development Environment","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044491014/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=P5dySnorbZI1b3V2xLPy8Wlzof4%3D","building-your-mouseless-development-environment",1795896878,{"doc_id":309,"doc_title":310,"file_type":137,"home_preview_img_url":311,"slug":312,"view_count":313,"category_name":29,"create_tm":314},116713,"BEST of BASH - 2026 Edition - Unsung Command-Line Tools","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229834364500/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=KqhXz9jIkaAbZZgTGHAi%2FyfPdxk%3D","best-of-bash-2026-edition-unsung-command-line-tools",41,1785663519,{"doc_id":316,"doc_title":317,"file_type":137,"home_preview_img_url":318,"slug":319,"view_count":101,"category_name":29,"create_tm":320},699566,"CS2043-Unix Tools & Scripting - lecture 04","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011312335/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=m%2FaRix6VGzXiZScrUHBxNNm%2FtaY%3D","cs2043-unix-tools-scripting-lecture-04",1794479393,{"doc_id":322,"doc_title":323,"file_type":137,"home_preview_img_url":324,"slug":325,"view_count":188,"category_name":29,"create_tm":326},686346,"Intro2LinuxMFF lesson1 - Introduction to the Linux OS","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000739120/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=0rj5yW0gIBk9ynQu1NIWh4JpZrY%3D","intro2linuxmff-lesson1-introduction-to-the-linux-os",1794037851,{"doc_id":328,"doc_title":329,"file_type":137,"home_preview_img_url":330,"slug":331,"view_count":223,"category_name":29,"create_tm":332},391868,"JMSTechOps - DevOps course curriculum - Offline Course Timings - Foundation-DevOps Principles","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229917408978/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=MVwof7z2iU%2B2dxFx7yYfeKK3jTw%3D","jmstechops-devops-course-curriculum-offline-course-timings-foundation-devops-principles",1790359549]