touch ~/test.txt chmod 755 test.sh 设置脚本的打开方式 右击脚本-》get info 设置teminal打开 系统偏好设置->用户与群组->登陆项,将test.sh添加到登陆项,重新启动即可