using ./
hello all,
whenever we have to execute any executable file why we use ./ before a.out please mail me answers as soon as possible. thanks bi Anupam |
By default the current working directory isn't in the PATH so you have to explicitly use ./ for your program to be found.
Oh yeah, good luck on your test ;) |
Because of the following scenario:
Malicious user is able to put malware into your home directory, with the same filename as a common command - "ls" or "cd", for instance. If just typing the filename worked, then you could run the malware instead of the proper file - infecting your computer. By requiring the ./ at the front, which specifies the current directory, the above scenario can never happen, as you would have to type "./ls" instead of just "ls" Good luck with the homework ;) |
All times are GMT -5. The time now is 08:13 PM. |