mis*_*t92 15 linux ubuntu automation rc
我正在研究Ubuntu 12.04并编写环境自动构建shell.在shell中我需要在rc.local中更改一些内容.
这是我现在的rc.local.
#!/bin/sh -e
#......
exit 0
Run Code Online (Sandbox Code Playgroud)
我想像这样修改它:
#!/bin/sh -e
#......
nohup sh /bocommjava/socket.sh &
exit 0
Run Code Online (Sandbox Code Playgroud)
现在我使用nano来修改它,有没有可以将行插入rc.local的命令?
sig*_*lha 29
使用Sed
用于测试
sed -e '$i \nohup sh /bocommjava/socket.sh &\n' rc.local
Run Code Online (Sandbox Code Playgroud)
真的修改
sed -i -e '$i \nohup sh /bocommjava/socket.sh &\n' rc.local
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14557 次 |
| 最近记录: |