I am wondering if there is a Unix equivalent for the Windows environment variable PATHEXT
.
For those with no Windows background: Adding a file suffix to PATHEXT
allows me to execute a script without typing that suffix in cmd.exe. For example, on my Windows computer, PATHEXT contains the suffix .pl
and when I want to execute a Perl script in cmd.exe, I simply can type my-script
and it gets executed. Yet, in order to execute the same script in bash, I need to write the full name: my-script.pl
.
Since I work on both Windows and Unix currently, I almost always fall into the trap of forgetting to type the suffix when going to a Unix box again.
.sh
preceedes.pl
,foo.sh
will be run. stackoverflow.com/a/7839178/180275git.exe
instead ofgit
, and ifgit
were the only one then an alias would be a fine solution, but I think I'll try the.bashrc
solution below.