/bin/bash -c 的作用

k8s的很多yaml的配置文件中,很多地方执行bash命令时 要加上 -c 。

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.

/bin/bash 后面默认执行的时脚本文件 。

加上 -c 之后会将字符串读入作为执行的命令。

posted @   zed99  阅读(725)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
历史上的今天:
2022-05-07 linux 中的here document
2022-05-07 linux中ctrl+c、ctrl+z、ctrl+d区别
点击右上角即可分享
微信分享提示