Utilizing the “say” command in terminal

為{幸葍}努か 提交于 2019-12-13 09:47:12

问题


Is there any way to make terminal execute the "say" command when I login to my laptop? I want it to have a greeting when I log in. Is that possible at all?


回答1:


Sure, paste the following into a file called greet in your HOME directory:

#!/bin/bash
say "Hello"

Then start the Terminal, and type

chmod +x greet

to make it executable.

Then go to the Apple menu at top-left of the screen, and click System Preferences->Users & Groups, then select your username, and on the right click Login Items. Click the little + sign and add the file called greet from your HOME directory.



来源:https://stackoverflow.com/questions/30030473/utilizing-the-say-command-in-terminal

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!