我有一个bash脚本:
echo " enter file name "
read $file
if [ -f "$file" ] && [ -s "$file" ]
then
echo " file does not exist, or is empty "
else
echo " file exists and is not empty "
fi
Run Code Online (Sandbox Code Playgroud)
无论我输入什么$file,它都给了我错误的价值.我甚至可以输入一个甚至不存在的文件,它仍然会给我错误的价值.为什么那些家伙?提前致谢
我这里有问题.好像我的Bash脚本忽略了do和之间的所有内容done.不知道为什么,也许你会看到问题.提前致谢.
katalogas=$1
find $katalogas -type f -mtime +3 | while read $failai
do
read -p "Run command $foo? [yn]" answer
if [[ $answer = y ]] ; then
rm $failai
fi
done
Run Code Online (Sandbox Code Playgroud) 问题:菜单项之间无法留出空间(至少 1 厘米)。
\n我是初学者,刚刚学习。我知道这个问题对于有经验的用户来说听起来很愚蠢。
\n这是代码:
\nbody {\n height: auto;\n width: auto;\n background-image: url("img/top.png");\n}\n\n.header {\n margin: 0px auto;\n max-width: 960px;\n}\n\n#header {\n height: 300px;\n width: 960px;\n background-image: url("img/top.png")\n}\n\n#menu ul {\n margin: 0px auto;\n margin-left: -20px;\n /*pull towards left*/\n margin-right: 20px;\n /*push towards right*/\n list-style: none;\n background: #3d3d5c;\n}\n\n#menu li {\n display: inline-block;\n}\n\n#menu li a {\n margin-left: -40px;\n color: #fff;\n text-decoration: none;\n display: block;\n background: red;\n padding: 0 10px 0 10px;\n height: 54px;\n width: 130px;\n line-height: 54px;\n}\n\n#menu li a:hover …Run Code Online (Sandbox Code Playgroud)