创建输出文件描述符

5年以前  |  阅读数:476 次  |  编程语言:Shell 
#!/bin/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"

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8