OpenEuler shell基础 nohup命令配合shell脚本
【摘要】 课程使用shell脚本 开发者空间-云主机使用开发者空间的云主机进行学习,方便快捷,推荐! shellOpenEuler shell基础 nohup命令配合shellhw.sh 内容[developer@developer Desktop]$ cat hw.sh #!/bin/bashecho "hello world"nohup与shell脚本[developer@developer D...
课程
开发者空间-云主机
使用开发者空间的云主机进行学习,方便快捷,推荐!
shell
-
OpenEuler shell基础 nohup命令配合shell
-
hw.sh 内容
[developer@developer Desktop]$ cat hw.sh
#!/bin/bash
echo "hello world"
- nohup与shell脚本
[developer@developer Desktop]$ nohup ./hw.sh
nohup: 忽略输入并把输出追加到'nohup.out'
[developer@developer Desktop]$ ls
blog.desktop hw.sh nohup.out
dev_line.desktop iDME╔ш╝╞╖■╬ё.desktop project_resoruce.desktop
gitcode.desktop lab.desktop storage.desktop
[developer@developer Desktop]$ cat nohup.out
hello world
- & 起到后台运行脚本的作用
[developer@developer Desktop]$ cat nohup.out &
[1] 13037
hello world
[1]+ 已完成 cat nohup.out
- 查看nohup的帮助信息
[developer@developer Desktop]$ nohup --help
用法:nohup 命令 [参数]...
或:nohup 选项
忽略挂起信号运行指定的命令。
--help 显示此帮助信息并退出
--version 显示版本信息并退出
如果标准输入是一个终端,则将其重定向为使用一个无法读取的文件。
如果标准输出是一个终端,在可能的情况下将输出附加到“nohup.out”,
否则使用“$HOME/nohup.out”文件。
如果标准错误输出是一个终端,重定向它到标准输出。
要保存输出内容到一个文件,使用 "nohup COMMAND > FILE" 形式的命令。
注意:您的shell 可能内置了自己的nohup 程序版本,它会覆盖这里所提及的相应
版本。请查阅您的shell 文档获知它所支持的选项。
GNU coreutils 在线帮助:<https://www.gnu.org/software/coreutils/>
请向 <http://translationproject.org/team/zh_CN.html> 报告任何翻译错误
完整文档 <https://www.gnu.org/software/coreutils/nohup>
或者在本地使用:info '(coreutils) nohup invocation'
[developer@developer Desktop]$
【声明】本内容来自华为云开发者社区博主,不代表华为云及华为云开发者社区的观点和立场。转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息,否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)