我有一个非常重要的问题,我一直是牛赛剑龙的粉丝(包裹),它会读取命运、输入等。所以自然而然地,让这个雄伟的生物告诉我今天是什么日子对我来说非常重要每天。我使用用户输入制作了以下脚本:
#!/bin/bash
selection=
until [ "$selection" = "0" ]; do
echo ""
echo "PROGRAM MENU"
echo "1 - It's Monday!"
echo "2 - It's Tuesday!"
echo "3 - It's Wednesday!"
echo "4 - It's Thursday!"
echo "5 - It's Friday!"
echo "6 - Custom input"
echo "7 - Exit"
echo ""
echo -n "Enter selection: "
read selection
echo ""
case $selection in
1 ) cowsay -f stegosaurus "It's Monday!"
exit ;;
2 ) cowsay -f stegosaurus "It's Tuesday!"
exit ;;
3 ) cowsay -f stegosaurus "It's Wednesday!"
exit ;;
4 ) cowsay -f stegosaurus "It's Thursday!"
exit ;;
5 ) cowsay -f stegosaurus "It's Friday!"
exit ;;
6 ) echo -n "custom input > "
read custom
cowsay -f stegosaurus "$custom"
exit ;;
7 ) exit ;;
* ) cowsay -f stegosaurus "Guess what day it is?"
exit ;;
esac
done
然而,这是我在 linux 发行版上的第一个脚本之一,我已经准备好通过使其在当天自动更新(如果可以的话,甚至可能是一小时)来增强我的创作。但是,到目前为止我还无法做到这一点。任何人都可以帮助我或指出正确的方向吗?
我会非常感谢任何建议,非常感谢提前!