Y
Hacker News
new
|
ask
|
show
|
jobs
by
nneonneo
1064 days ago
If you
do
need single quotes in the inner command, you can use the "'" trick:
ssh host -- ls "'"'folder$name'"'"
1 comments
me-vs-cat
1063 days ago
$name will never be expanded. Is that what you expected?
link
nneonneo
1063 days ago
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 $.
link