Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not define var in a function in the eof text #3

Open
YMC-GitHub opened this issue Nov 12, 2019 · 0 comments
Open

can not define var in a function in the eof text #3

YMC-GitHub opened this issue Nov 12, 2019 · 0 comments

Comments

@YMC-GitHub
Copy link
Owner

Expected behavior

expected to ouput:192.168.2.5,192.168.2.5,eth0,eth0

actual behavior

actual to ouput:,192.168.2.5,,

Steps to reproduce the problem

run the code in pm win with git-bash:

PRIVITE_KEY_FILE_NAME=google-clound-ssr
PRIVITE_KEY_FILE_PATH=~/.ssh/
OLD_VM_SSH_SERVER_IP=192.168.2.2
OLD_VM_SSH_SERVER_USER=root
NEW_VM_SSH_SERVER_IP=192.168.2.5
ssh -tt -i ${PRIVITE_KEY_FILE_PATH}${PRIVITE_KEY_FILE_NAME} $OLD_VM_SSH_SERVER_USER@$OLD_VM_SSH_SERVER_IP << EOF
ls
echo $NEW_VM_SSH_SERVER_IP
function hi(){
NET_CARD_NAME=eth0
echo $1,$NEW_VM_SSH_SERVER_IP,$NET_CARD_NAME,${NET_CARD_NAME} #,192.168.2.5,,
}
hi $NEW_VM_SSH_SERVER_IP
EOF

the version of the project, operating system, or hardware

#######on pm######
pm-os:win10 64
git:git version 2.21.0.windows.1
#######on vm######
vm-os:linux centos 64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant