Reputation: 13239
I'm new to using Terminal for compiling code. In the following
gcc inputfile.m -o outputfile
./outputfile
What does the ./ mean?
Thanks
Upvotes: 0
Views: 88
Reputation: 45118
./outputfile
tells Bash (the program that runs the Terminal) to run the file outputfile
which is located in the current directory (./
)
Bash can run any file, whether is a compiled file (like you case) or a script.
Upvotes: 1
Reputation: 1356
That is your compiled program. The line ./outputfile
is calling the executable you created. It may seem a little strange that you have to do this in your case because you are only using 1 input file, but imagine that you are creating a bigger program with a many files that all need to be compiled together.
gcc inputfile1.m inputfile2.m class1.m class2.m main.m -o outputfile
All those files would be compiled and put into outputfile.
Upvotes: 0