linux-tutorial/codes/shell/示例脚本/输入和输出/列出当前脚本打开的文件描述符.sh

15 lines
121 B
Bash

#!/bin/bash
# testing lsof with file descriptors
exec 3>test
exec 6>test
exec 7<test
lsof -a -p $$ -d0,1,2,3,6,7