linux-tutorial/codes/shell/输入和输出/创建自己的重定向/创建读写文件描述符.sh

9 lines
142 B
Bash

#!/usr/bin/env bash
# testing inpiut/output file descriptor
exec 3<> test
read line <&3
echo "Read: $line"
echo "This is the test line" >&3