Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

If you do need single quotes in the inner command, you can use the "'" trick:

    ssh host -- ls "'"'folder$name'"'"


$name will never be expanded. Is that what you expected?


Yes, that’s the intent: using single quotes at both levels will prevent either your shell or the remote shell from expanding the name, so you can interact with a file name containing a literal $.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: