如何解决Bash命令用法含义
当我执行这样的命令时:
bash -c 'command1; command2; command3'
是什么意思?特别是“ -c”是什么意思?
解决方法
此问题已在此处回答: What does 'bash -c' do?
男子bash:
-c string If the -c option is present,then commands are read from string.
If there are arguments after the string,they are assigned to the positional
parameters,starting with $0.
,
来自man bash
:
如果存在-c选项,那么将从第一个非选项参数command_string中读取命令。如果在command_string之后有参数,则第一个参数分配给$ 0,其余所有参数分配给位置参数。分配给$ 0设置外壳的名称,该外壳名称用于警告和错误消息。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。