Viruses are targeted at a specific vulnerability and most of those are operating system specific. And most viruses are still written for Windows. Partly this is because Windows is still the most common business OS and that is a more lucrative target, but while Microsoft is pretty good now about patching security holes, Windows core design was not for a network while Unix was designed for a multi-user environment from the start (and MacOS is built on top of Unix).
Portable devices have simpler operating systems because they were initially designed to run on less powerful processors. They have also evolved from the start in the high threat environment of the internet, so making them secure as they went along was easier. Because a phone has a less powerful processor and most people don't store a lot of work stuff on their phones, they are less valuable targets.
Ultimately hackers are looking for something that will turn them a buck. They want a computer they can take over to use in denial of service attacks which they then will try to extort money out of the victim. Or they do ransomware attacks like the latest one. Installing a keylogger that gets password information when someone enters their password is another way they make money.
There are some kids playing around with virus toolboxes seeing what they can make. That was what most of the early generation viruses were and those tended to be just pranks the kids made to see if it can be done. The serious virus writers today are trying to make money from it.
There are some viruses that do target Unix, Linux, and portable OSs, but they are still somewhat rare. Unix and Linux systems are usually more secure and portable OSs are too low value a target.
In this case if the script was malformed, it probably wasn't much of a threat to anyone.