I have a bash script that attempts to synchronize the time on another machine. It is not my source code, but as I am refactoring bash script, I am trying to get it to pass ShellCheck.
The source code for it looks something like this:
d=$(date -u +%m%d%H%M%Y.%S)
ssh decs@host-zc1 "sudo date -u ${d}"
The ShellCheck warning is SC2029 and states "Note that, unescaped, this expands on the client side.". In fact I don't want to escape this.
Is there another way to get rid of this warning and yet perform this step?