Hey,
I am trying to run a "Mac-Renaming" Skript via Policy, but it shows me something like this in the policy log:

if i run the skript on the mac itself it works just fine, but as soon as I try to deploy it via Policy i get this error.
here is the Skript:
#!bash/sh
arr=( $(ls /users) )
str=${arr[@]:3}
year=$(date +%Y)-
lengthUsername=${#str}
substr="${str:2:$lengthUsername}"
sudo /usr/local/bin/jamf setcomputername -name "$year$substr"
sudo /usr/local/bin/jamf recon
can someone help me to find the issue?