question on shell script

when i run a shell script i have to type
./my_prog

and the first line of my_prog has to have
#!/usr/bin/env bash

how do i change it to i only have to type my_prog to run it?

Not recommended, especially if you are root, but here it is:

PATH=$PATH:.

what do u mean if i am root, and why is it bad to do this?
and is there a way that instead of using that command, i can edit my_prog and still achieve this?

It's insecure. You'd have no control over which directories you'd run programs from. Something could dump a suspicious program named 'ls' in your home directory and have you run it by accident. This is especially bad for root for obvious reasons.

That's not how it works. The shell script doesn't control whether you're allowed to run it or not. Your shell uses your PATH to determine where programs come from and that's it.

Put it in a directory in your $PATH and then your shell will be able to find it.

Traditionally custom commands get put in /usr/local/bin/. Put your script in there, and edit your PATH to contain /usr/local/bin/.

"If I am root" means "If I'm logged in as root".
It is "bad" because you might run "hostile" commands you wouldn't want if someone else has accessed your machine. However, putting the current directory at the end of your PATH mitigates that risk.