剧本:
waktu=$(date +"%H")
kelompok="E20"
dir_skrg=$(pwd)
if (( $waktu >= 5 && $waktu <= 10 ))
then
salam="pagi"
elif (( $waktu >= 10 && $waktu <= 3 ))
then
salam="siang"
elif (( $waktu >= 4 && $waktu <= 7 ))
then
salam="sore"
else
salam="malam"
fi
echo “Selamat $salam $kelompok dengan user $USER, sekarang pukul $waktu dan pada direktori $dir_skrg”
Run Code Online (Sandbox Code Playgroud)
它给出了错误:
script1.sh: 5: script1.sh: 14: not found
script1.sh: 8: script1.sh: 14: not found
script1.sh: 11: script1.sh: 14: not found
Run Code Online (Sandbox Code Playgroud)
但不是在我朋友 ubuntu 的。有人知道为什么吗? …
bash ×1