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

15 lines
132 B
Bash

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