> For the complete documentation index, see [llms.txt](https://appsecurity.gitbook.io/devops/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://appsecurity.gitbook.io/devops/ppc/ppc-langs/bash/prostye-operacii/postrochnoe-chtenie-faila.md).

# Работа с файлами

## Построчное чтение файла

```bash
exec 9<config.txt

while read line <&9; do
    echo "$line"
done

exec 9<&-
```

## Чтение файла в переменную

```bash
#!/bin/bash

target=$(<input.txt)
echo "$target"
```
