# "Debug" mode

> $ cat hello.sh
>
> ```
> !/bin/bash
> echo "Hello World" 
> ```

> bash -x hello.sh
>
> echo Hello World&#x20;
>
> Hello World

`-x` 參數使您可以依序執行腳本中的每一行，了解執行流程。這裡有一個很好的例子：

$ cat hello.sh

> !/bin/bash
>
> echo "Hello World\n"&#x20;
>
> adding\_string\_to\_number="字串"&#x20;
>
> v=$(expr 5 + $adding\_string\_to\_number)
>
> $&#x20;

```
./hello.sh 
Hello World
expr: non-integer argument
```

```
$ bash -x hello.sh 
+ echo Hello World\n
Hello World

+ adding_string_to_number=s
+ expr 5 + s
expr: non-integer argument
+ v=
```


---

# 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://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled-4/shell-script/debug-mode.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.
