Posted on 03-23-2022 03:10 AM
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?
Posted on 03-23-2022 04:24 AM
Change this line;
#!bash/sh
To;
#!/bin/sh
Posted on 03-23-2022 04:26 AM
I'd try changing #!bash/sh to either #!/bin/bash or #!/bin/sh