I noticed that every executable that I need I need by a ./
to run it on both Linux and MacOS (Unix / Unix-like systems). For example, to compile a C file with GCC and run it right away, I make the following commands:
$ gcc fonte.c
$ ./a.out
This also applies when I create a shell script:
$ vim script.sh
$ chmod u+x script.sh
$ ./script.sh
On the other hand, when I do it in Windows, I do not need to ./
up front. For example, if I create a bat
, in the exemplo
folder, just call cmd
and execute the script directly:
$ cd exemplo
$ script.bat
Even when I use MingW (as git bash
provided by SourceTree), which is a more "uniched" environment within Windows, I do not need ./
either. Taking the same example of the shell script generation in Linux, git bash
would look like this:
$ vim script.sh
$ script.sh
Questions
./
to run my executables in the current working directory? ./
? (Not the .\
equivalent in the Windows directory separator notation?)