Вопрос

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