[英]Adding script in Linux to display date at start up terminal bash shell
I have a hw problem where I need to make the date appear at the start up screen of the terminal in bash shell.我有一个硬件问题,我需要在 bash shell 的终端启动屏幕上显示日期。 I was able to save date script using nano, but am now stumped on how to get it to show up when launching terminal.
我能够使用 nano 保存日期脚本,但现在我对如何在启动终端时显示它感到困惑。 Any help is appreciated.
任何帮助表示赞赏。
You can create a desktop shortcut launcher that will start your script in a terminal.您可以创建一个桌面快捷方式启动器,它将在终端中启动您的脚本。
$ gedit ~/Desktop/dateterminal.desktop
Copy the following (change the exec line to your script)复制以下内容(将 exec 行更改为您的脚本)
[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
Exec=/path/to/your/date/script
Name=whatever you want
Icon=
After creating right click on the launcher > Properties > Permissions > & check the Execute: box创建后右键单击启动器 > 属性 > 权限 > 并选中执行:框
mkdir -p ~/.scripts # Put your script in ~/.scripts echo ". ~/scripts/yourscript.sh" >> ~/.bashrc source ~/.bashrc
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.