New We are sorting MAX channels into categories and territories. Read the news

Примеры



📌Открыть файл на чтение в FD 3

exec 3< file.txt
read line <&3
echo "$line"
exec 3<&-

📌Открыть файл на запись в FD 4

exec 4> output.log
echo "Hello" >&4
exec 4>&-

📌Одновременно читать один файл и писать в другой

exec3< input.txt
exec 4> output.txt

while read -r line <&3; do
echo "[LOG] $line" >&4
done

exec 3<&-
exec 4>&-

📌Читать два входных файла одновременно

exec 3< fileA.txt
exec 4< fileB.txt

read A <&3
read B <&4

echo "A: $A"
echo "B: $B"

exec 3<&-
exec 4<&-
Views: 6
Open in MAX Report an inaccuracy

Report an inaccuracy

Describe what needs fixing. If you have a source, add a link.

You are leaving datool.ru

The link leads to an external website. datool.ru is not responsible for its content — check the address before entering passwords or payment details.

Redirecting in 10 s

Go