【发布时间】:2020-11-09 06:03:41
【问题描述】:
退出 ssh 后,我可以在 git bash(适用于 Windows)中从 ssh 会话中导出变量吗?
我想做的是这样的。
- 为 Windows 执行 git bash。
- 执行 ssh。
$ ssh root@192.168.xx.xx
- 为变量设置一些值。
root@localhost:~# A=1
root@localhost:~# echo $A
1
- 退出 ssh。
root@localhost:~# exit
logout
Connection to 192.168.xx.xx closed.
- 在 git bash 上使用我在步骤 3 中设置的值。
- 想要的结果
$ echo $A
1
- 实际结果
$ echo $A
有什么办法可以做到吗?
【问题讨论】:
标签: bash ssh environment-variables