문제

I need a remote machine to print the absolute path of a given file hosted on it, so I do:

ssh me@remote.host.net "echo '$(pwd)/file.txt'"

Too bad this way pwd gets evaluated locally, not remotely. How can I do this?

도움이 되었습니까?

해결책

Flip the quotes:

ssh me@remote.host.net 'echo "$(pwd)/file.txt"'
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top