Is that all you need to run in the Action? If yes, then all you need to do is run it verbatim in the Action, just pick the “sh” entry from the Action Script Type pop-up menu.
Write out the script to a file with “appendfile” and execute it using “waithidden”, perhaps? Otherwise you will need Relevance that replicates the functions of script and that will require constructive thought* to write given that your shell script has a “for loop” in it.
*It’s 9am Calif. time and the Peet’s hasn’t kicked in yet