I want to get the home directory of a GCP instance by
p=$(gcloud compute ssh INSTANCE_NAME -- 'echo ${HOME}')
Suppose the p
equals to /home/abc
.
Then I do a simple str concat and echo with
echo ${p}/xx
I would naturally expect
/home/abc/xx
Instead, it returns
/xxme/abc
Interesting enough, later chars xx
displaces previous ones ho
. How come? Any one with the fix?