#!/bin/bash
export PATH="${PATH}:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/bin:/usr/bin:/usr/local/jdk/bin:/usr/local/jdk/jre/bin:/usr/local/app/bin:/usr/local/mysql/bin"
export LANG=C
LOG_FILE="${0##*/}.log"
ERR_FILE="${0##*/}.err"
exec 6>&1
exec 7>&2
exec 1>${LOG_FILE}
exec 2>${ERR_FILE}
exec 8<>${LOG_FILE}
ls -l /proc/$$/fd
ls fuck # file file is not exist for testing fd2
exec 1>&6
exec 2>&7
exec 6<&- # 或者exec 6>&-都可以关闭掉
exec 7<&-
exec 8<&-
ls -l /proc/$$/fd
ls fuck
exit 0
阅读(903) | 评论(0) | 转发(0) |