利用“说"终端中的命令 [英] Utilizing the "say" command in terminal

查看:78
本文介绍了利用“说"终端中的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

登录到笔记本电脑后,是否可以使终端执行"say"命令?我希望登录时打个招呼.那有可能吗?

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?

推荐答案

当然,将以下内容粘贴到HOME目录中的名为greet的文件中:

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

使其可执行.

然后转到屏幕左上方的Apple菜单,然后单击System Preferences->Users & Groups,然后选择您的用户名,然后在右侧单击Login Items.单击小+标记,然后从您的HOME目录添加名为greet的文件.

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.

这篇关于利用“说"终端中的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆