From recollection you need to put sudo in front of the command - unless you’ve already set your account up for passwordless sudo it will prompt for your sudo password. Clearly this won’t work well from a script so Google Linux no password sudo. It involves editing the sudoers file using the command ‘sudo visudo’
Tried putting sudo before each gpio command. Didn't work. Same problem.
Did you try "raspi-gpio" instead?
Ok , are you mixing up physical pins from their logical GPIO numbers?
This is a good explanation even though it’s for Ubuntu which is a variant of Debian. https://manpages.ubuntu.com/manpages/jammy/man1/gpio.1.html
Python or any other language with a working library.
That worked, but it invoked an entirely different library. It has different parameters than the older gpio library.