I’m using Drone’s new SSH runner (it’s really good!), but I’m having some trouble where a command involves some bash shell expansion. In particular, trying to restart a bunch of services like systemctl --user restart server@{1..8}.service does not seem to work? Must I escape it, or is there another way to do what I want? How would I go about doing that?
Drone would not make any changes to this command since it is not a bash variable (does not match ${variable} syntax), so there is no need to escape anything. Drone takes the above command and generates a shell script, uploads that shell script to your server (using sftp) and then executes it. The generated shell script looks something like this:
Unfortunately we do not really have the full details details (error message, steps to reproduce, etc) so it is difficult for me to advise on possible root causes without speculating. However, one common root cause we see is that sometimes people use bash syntax which may not be compatible with sh, or may not be compatible with the version of sh installed on the target machine.
And I was talking about shell expansion, so things like {1..3} would convert to 1 2 3, etc. It seems the bare bones shell does not support it, which is a shame Is it possible to change the default shell back to bash?