I'm learning how to create shell scripts on UNIX for a college class. The textbook says I should just be able to type the filename in my terminal and it should run, but so far I haven't been able to get that to work. But it works fine when I type in ./myscript
.
Currently, I am typing the scripts out on my Mac terminal, but I had FreeBSD loaded onto a virtual box and it was doing the same thing to me.
I think maybe I need to change my environment path? I remember I had to do that when I started writing python files.
.
in their PATH which means, at some point, if not found elsewhere, the search will be in current directory. Especially for root or any kind of high power user this is a security nightmare about to happen, so it is best not to have it and force users to input the full path name. – Patrick Mevzek Aug 31 '18 at 02:00