SHELL Command works fine as a standalone command, but fails when put into a shell script? Android 8.1 PIXEL 2 with root access. 

I have seen this asked here once before but the only solution didn't help me at all. I am going to try and make this as simple as I can for the example. 

If I run the following command in terminal emulator or adb shell:

am force-stop com.myapp.frustrated


It will quit the app just fine. But when I run it in this shell script:

#!/bin/sh
am force-stop com.myapp.frustrated


Nothing happens. It is odd to me that I can do many other commands just fine in a script, but a handful of them do not work. 

Any suggestions you have are much appreciated.
Removing #!/bin/sh fixed my issue. Thanks