Learn the Command Line Course on codecademy, it was provided how to configure our personal bash environment so we can access a file from anywhere by typing the filename.
The configuration was:
When I used this configuration on my system it didn’t happened that way.
User@User-PC MINGW64 / $ cd User@User-PC MINGW64 ~ $ export PATH=~/bin:$PATH User@User-PC MINGW64 ~ $ script.sh bash: script.sh: command not found User@User-PC MINGW64 ~ $ ./script.sh bash: ./script.sh: No such file or directory
I used the file name as
script.sh and also included
#!/bin/bash at the start of the file and
chmod +x script.sh at the end of the file.
The link to the respective page of the course is: https://www.codecademy.com/courses/learn-the-command-line/lessons/learn-bash-scripting/exercises/introduction