> For the complete documentation index, see [llms.txt](https://notes.eliasnorrby.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.eliasnorrby.com/bash.md).

# bash

- [Case statement](https://notes.eliasnorrby.com/bash/case-statement.md)
- [Change quote style mid-string](https://notes.eliasnorrby.com/bash/change-quote-mid-string.md)
- [Comparing versions](https://notes.eliasnorrby.com/bash/comparing-versions.md)
- [Hiding credentials on the command line](https://notes.eliasnorrby.com/bash/credentials-on-command-line.md)
- [Directory of script](https://notes.eliasnorrby.com/bash/directory-of-script.md)
- [Using find to run a command on multiple files](https://notes.eliasnorrby.com/bash/find-exec.md)
- [Getting the line number of the nth match](https://notes.eliasnorrby.com/bash/get-line-number-of-nth-match.md)
- [Getopts](https://notes.eliasnorrby.com/bash/getopts-flags.md)
- [Parsing output with long lines using less](https://notes.eliasnorrby.com/bash/less-without-wrap.md)
- [Print line at number](https://notes.eliasnorrby.com/bash/print-single-line.md)
- [Remove final newline](https://notes.eliasnorrby.com/bash/remove-final-newline-from-output.md)
- [Reading content between markers](https://notes.eliasnorrby.com/bash/sed-awk-read-between-markers.md)
- [Determine if a script was sourced or executed](https://notes.eliasnorrby.com/bash/sourced-or-executed.md)
- [Bash substring](https://notes.eliasnorrby.com/bash/substring-contains.md)
- [Run a function on interrupt or error](https://notes.eliasnorrby.com/bash/trap-ctrl-c-err-cleanup.md)
- [Reference variable by name](https://notes.eliasnorrby.com/bash/variable-by-name.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://notes.eliasnorrby.com/bash.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.
