小编Hai*_* M.的帖子

我的电脑中的 Bash 脚本错误,但在其他一些电脑上没有

剧本:

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

3
推荐指数
2
解决办法
273
查看次数

标签 统计

bash ×1