rc.common不能在Mac OS X上运行 [英] rc.common not run on mac os x

查看:60
本文介绍了rc.common不能在Mac OS X上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在启动时运行shell脚本

I want to run a shell script on startup

通过google,我发现我可以在rc.common中添加shell

by google ,I found that I could add shell in rc.common

所以我在rc.common的末尾添加了以下代码

so I added the code below at the end of rc.common

这是权限问题吗?

## rc.common test ##
touch ~/test.txt

重新启动,我的用户文件夹中没有test.txt

reboot,there is no test.txt in my user fold

当我在终端上手动测试时,就可以了

when I test it in terminal manualy ,it's ok

ls -l /etc/rc.common
-rw-r--r--  1 guirong  wheel  1737  3 30 22:36 /etc/rc.common

问题出在哪里?我的系统版本是10.7.3是不是默认在os x中运行?

where is the problem? my system verison is 10.7.3 is it not ran by default in os x?

推荐答案

如果只想为当前用户运行脚本,则应改用〜/.bashrc.

If you want the script to be run only for the current user, you should use ~/.bashrc instead

后来我误解了你的问题.如果要在启动时运行某些内容,则应查看已启动的此处

Later edit: I misread your question. If you want something to run at startup, you should look into launchd here

这篇关于rc.common不能在Mac OS X上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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