/
githubmirror
/
lsof
Обзор
Документация
Войти
/
githubmirror
/
lsof
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/case-20-fd-only-inclusion.bash
35 строк
976 B
Jiajie Chen
Use /usr/bin/env bash for shebang because /bin/bash is not available on FreeBSD
18 янв 2023, 19:23
18 янв 2023, 19:23
25e0eee
Код
Авторство
О чём код?
#!/usr/bin/env bash source tests/common.bash echo "inclusion test" >> $report while read line; do if [[ $line =~ ^f[^0-9].* ]]; then echo "Unexpectedly, a named file descriptor is included: " echo "${line}" echo echo "## whole output for debugging (-d fd -F fd): " ${lsof} -p $$ -a -d fd -F fd echo "## whole output for debugging (-d fd): " ${lsof} -p $$ -a -d fd echo "## whole output for debugging (no -d): " ${lsof} -p $$ exit 1 fi done < <(${lsof} -p $$ -a -d fd -F fd) >> $report echo "exclusion test" >> $report while read line; do if [[ $line =~ ^f[0-9]+ ]]; then echo "Unexpectedly, a numbered file descriptor is included: " echo "${line}" echo "## whole output for debugging (-d fd -F fd): " ${lsof} -p $$ -a -d '^fd' -F fd echo "## whole output for debugging (-d ^fd): " ${lsof} -p $$ -a -d '^fd' echo "## whole output for debugging (no -d): " ${lsof} -p $$ exit 1 fi done < <(${lsof} -p $$ -a -d "^fd" -F fd) >> $report exit 0