# shell脚本时钟 **Repository Path**: godeni/shell-script-clock ## Basic Information - **Project Name**: shell脚本时钟 - **Description**: 使用shell脚本显示当前时间 - **Primary Language**: Shell - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-08-02 - **Last Updated**: 2024-04-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # shell脚本时钟 #### 介绍 使用shell脚本显示当前时间 ```shell #!/bin/bash while true do echo -n `date` sleep 1 tput rc tput ed done #tput sc: 存储光标位置 #tput rc: 恢复光标位置 #tput ed: 清除光标之后的数据 ``` 显示结果如下所示 ![输入图片说明](pict1.png) 上述代码逻辑很简单就是不停的进行清除与输出,那么我们如何进行全屏显示呢?下面给出效果图,希望这个小项目能帮助大家理解并熟悉shell脚本。 ![输入图片说明](pict2.png) #### 感谢 xoracle