In Mac OSX 13, Terminal, I am trying to run a shell script, ./writeimage.sh
I cd into the folder,
I see the writeimage.sh file is there with ls -l
I see it’s permissions are set correctly to 700 (rwx for me)
I use the ./ prefix because this script is not in the Path.
I stick a sudo in front, in case there is some privilege issue.
Terminal returns "sudo: writeimage.sh: command not found"
I’m out of ideas – anyone know why this is happening? What am I missing?
Thanks for any help!
-----MacBook-Air Downloads % ls -l
total 543176
..
..
-rwx------@ 1 lf staff 4402 10 Mar 22:41 writeimage.sh
----Downloads % sudo writeimage.sh -d /dev/disk5s1 -i "motioneyeos-raspberrypi-20200606.img.xz"
Password:
sudo: writeimage.sh: command not found
>Solution :
Check the shebang line:
- The shebang line at the top of the script specifies which interpreter should be used to run the script. Make sure this is correct for your system.
- For example, if you are using bash, the shebang line should be
#!/bin/bash.