# Task1参考答案

## 什么是shell

![操作系统架构](https://www3.nd.edu/~pbui/teaching/cse.30341.fa17/static/img/house.png)

## 常用的shell命令

* 文件与目录

```bash
ls
```

列出当前目录内容

```bash
cd /home/
```

进入home目录

* 安装软件

```bash
yum install vim
```

安装vim

## shell脚本编写

* 变量

第一个脚本的编写

1. 编辑run.sh，vim run.sh
2. 按下"i"进入编辑模式,输入:

```bash
NAME="Hello"
echo $NAME
```

1. 保存，:wq
2. 执行，bash run.sh

* 循环

```bash
for ((i = 0 ; i < 100 ; i++)); do
  echo $i
done
```

* 条件判断

```bash
if [[ X ]] && [[ Y ]]; then
  ...
fi
```

* 函数

```bash
function sayHello() {
    echo "hello $1"
}
sayHello "John"
```


---

# 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://codingling.gitbook.io/study/tool/bigdata/task1-can-kao-da-an.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.
