# C

1. 分享篇老文 \
   Tutorial - Write a Shell in C \
   <https://brennan.io/2015/01/16/write-a-shell-in-c/>

   之前使用 Golang 写过 一个简易的 Shell，原理很简单。

   文中介绍了下：Let’s look at a shell from the top down. A shell does three main things in its lifetime.

   Initialize: In this step, a typical shell would read and execute its configuration files. These change aspects of the shell’s behavior. Interpret: Next, the shell reads commands from stdin (which could be interactive, or a file) and executes them. Terminate: After its commands are executed, the shell executes any shutdown commands, frees up any memory, and terminates.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://thinking.simonaking.com/tags/pl/c.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
