Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 使用ulimit-f时陷阱信号SIGXFSZ不工作_Linux_Bash_Signals_Ulimit_Bash Trap - Fatal编程技术网

Linux 使用ulimit-f时陷阱信号SIGXFSZ不工作

Linux 使用ulimit-f时陷阱信号SIGXFSZ不工作,linux,bash,signals,ulimit,bash-trap,Linux,Bash,Signals,Ulimit,Bash Trap,在脚本中应用ulimit-f时尝试捕获信号SIGXFSZ 我的尝试: script: #! /bin/bash function catch_SIGXFSZ { echo "caught!!" } echo running ulimit -f 1 trap catch_SIGXFSZ 25 cat bigtmp.log > tmp.log echo after 跑步后,我得到: ./try.sh running File size limit exc

在脚本中应用ulimit-f时尝试捕获信号SIGXFSZ 我的尝试:

script:
#! /bin/bash
function catch_SIGXFSZ {
    echo "caught!!" 
}

echo running
ulimit -f 1

trap catch_SIGXFSZ 25

cat bigtmp.log > tmp.log

echo after
跑步后,我得到:

./try.sh
running
File size limit exceeded
after
知道为什么陷阱不起作用吗? 谢谢你的帮助