bash shell脚本的多个命令 [英] Multiple command for bash shell script

查看:131
本文介绍了bash shell脚本的多个命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在执行命令集后分配一个变量 第一个命令是进入openshift pod的外壳.然后整理一个文件,并将其分配给openshift容器外部的变量.

I want to assign a variable after executing the set of commands The first command is to get into the shell of the openshift pod. Then cat a file and assign that to a variable outside the openshift container.

我这样尝试过

check=$(oc rsh pod << EOF
cat /var/lib/jenkins/.ssh/check.pub
EOF)

这给我一个错误

bash: warning: here-document at line 41 delimited by end-of-file (wanted `EOF')

推荐答案

我相信第二个EOF本身需要排成一行:

I believe the second EOF needs to be on a line by itself:

check=$(oc rsh pod << EOF 
cat /var/lib/jenkins/.ssh/check.pub 
EOF
)

这篇关于bash shell脚本的多个命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆