我正在尝试使用-f命令以及文件Bath来检查某些文件的存在,但是我遇到了错误。这是我的脚本:
initUCounter="/home/teeba/users_counter_initial_value"
initPCounter="/home/teeba/number_of_processes"
if [! -f $initUCounter && ! -f $initPCounter]
then
echo "0" > /tmp/users_counter_initial_value
echo "1" > /tmp/processes_counter_initial_value
fi
除了您可以使用Rmano的答案之外,
if [ ! -f $initUCounter ] && [ ! -f $initPCounter ]; then
some action
else
some other action
fi
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句