Are Shell Commands Threaded?

If I execute a shell command from within HA is it threaded in a way that if HA is restarted that the shell command is terminated?

For instance, let’s say I execute a long shell script that talks to another computer, via SSH, and is doing a big process, such as copying a bunch of files from point A to point B, then HA is restarted (not the rPi, just HA), would that shell command terminate mid-copy?