linux-tutorial/codes/shell/输入和输出/创建自己的重定向/创建输出文件描述符.sh
2019-10-29 18:22:19 +08:00

10 lines
213 B
Bash

#!/usr/bin/env bash
# using an alternative file descriptor
exec 3> test
echo "This should display on the monitor"
echo "and this should be stored in the file" >&3
echo "Then this should be back on the monitor"