7 ms·
> Let’s say we need to delete a file on host a@a. The name of the file is in a variable A. How can we do it? > [...] > Anyway, the correct answer is: `ssh a@a
by xkxx 10y ago
> Let’s say we need to delete a file on host a@a. The name of the file is in a variable A. How can we do it?
> [...]
> Anyway, the correct answer is: `ssh a@a "rm -- $(printf '%q\n' "$A")"`
In zsh it's just `ssh a@a "rm -- ${(q)A}"`.