

关于shell中使用ssh的变量问题
source link: http://blog.colorccm.com/2020/11/06/it/shell_ssh/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

关于shell中使用ssh的变量问题
在shell中使用ssh对远程服务器进行操作,对于变量需要特殊标记。
localparam="hello"
ssh user@ip <<EOF
echo ${localparam}
remoteparam="world"
echo \${remote} #远程的变量需要用\$
EOF
例如需要ssh到远程服务器上操作,并且有for循环操作的,就需要注意远程变量的问题
ssh user@ip <<EOF
for i in $(echo test.txt)
do
echo ${i} #无法正确显示
echo \${i} #可以正确显示
done
EOF
Recommend
-
19
关于SSH远程执行命令和环境变量的问题 Oldpan 2020年7月15日 0条评论 669次阅读 0人点赞 不论是在学校里还是在公司中...
-
16
Ruby Net :: SSH method indefinite 'shell' advertisements I'm trying to log into a remote machine using SSH in my Ruby code and then trying to...
-
8
Reading Time: 3 minutes Hello readers, if you are new to this term ssh, then this is the blog for you. I’ll cover SSH from basic, laying down its importance and will show you how to configure SSH for remotely ac...
-
10
shell script for ssh advertisements Could anyone plese help me for creating a shell script. my script is something like this. I am a very begi...
-
11
linux shell脚本 ssh 获取变量问题 ...
-
8
V2EX › C 请教一个关于线程条件变量的问题 commoccoom · 1 天前 · 686 次点击 两个...
-
7
Creating a user with Shell (SSH) access Overview A user assigned to your website is the username you use to log into your server using an FTP program, or a terminal application. Th...
-
11
An Introduction to SSH – Secure Shell Reading Time: 4 minutes What is SSH ? SSH is a network protocol that all...
-
58
...
-
12
shell实现批量分发ssh公钥生产实践: 批量分发公钥学习技巧: for循环及expect使用脚本内容:
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK