bash - bash -s 有什么作用?

标签 bash ubuntu terminal

我是 bash 的新手并试图了解下面的脚本在做什么,我知道 -e 是退出但我不确定 -se$delimiter 的作用是什么?

$delimiter = 'EOF-MY-APP';

$process = new SSH(
    "ssh $target 'bash -se' << \\$delimiter".PHP_EOL
        .'set -e'.PHP_EOL
        .$command.PHP_EOL
        .$delimiter
);

最佳答案

-s 选项通常与 curl $script_url | 一起使用。 bash 模式。例如,

curl -L https://chef.io/chef/install.sh | sudo bash -s -- -P chefdk

-s 使 bash 从 stdin 读取命令(“curl”下载的“install.sh”代码),并且仍然接受位置参数。

-- 让 bash 将后面的所有内容都视为位置参数而不是选项。

bash 会将“install.sh”代码的变量$1$2 设置为-Pchefdk,分别。

引用:https://www.experts-exchange.com/questions/28671064/what-is-the-role-of-bash-s.html

关于bash - bash -s 有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37224634/

相关文章:

postgresql - 初始化数据库 : error: program "postgres" is needed by initdb but was not found using circleci ubuntu docker-compose docker-entrypoint-initdb. d

terminal - 将终端选项卡保存到已保存的工作区 VSCode

regex - Grep 表达式排除了我想要的一些匹配项

python - 在传入设置时使用 shell 脚本运行自定义 django manage.py 命令

regex - 使用sed删除第10个字符和第10个之后的第一个句点之间的字符

ruby-on-rails - 我应该把我的 chromedriver 文件放在哪里?

Bash:循环、复制、备份

c++ - 链接器错误,在 ubuntu 15.04 上使用 OpenCV 和 Eclipse CDT

linux - Bash:如何使用两个单独的 echo 命令回显 "hey"和 ", how are you?"?

c - 当你用&号调用相同的进程时,视觉上会发生什么