标题: 请教:这段脚本是什么意思 [打印本页] 作者: 通用寄存器 时间: 2007-11-16 16:27 标题: 请教:这段脚本是什么意思 # Redirecting only stderr to a pipe.
exec 3>&1 # Save current "value" of stdout.
ls -l 2>&1 >&3 3>&- | grep bad 3>&- # Close fd 3 for 'grep' (but not 'ls').
exec 3>&- # Now close it for the remainder of the script.