On 1/8/06, Mike McMullin
On Sun, 2006-01-08 at 13:14 +0530, Shriramana Sharma wrote:
Sunday, 08 January 2006 11:09 samaye, Tom Peters alekhiit:
Where is it? Your current directory is not checked for executables in most shells, unlike that toy o/s MS-DOS. If there isn't a PATH to it, you will definitely have to specify ./filename
Thanks, all, for your interest. Apparently my previous post to the list was not delivered to the list because Simon Roberts's reply had a reply-to header to his id.
I have since been able to successfully run many programs using ./filename, but I do wonder why the current directory is not checked. What is wrong with that behaviour? And why should the DOS shell be derided for providing this facility?
PWD may or may-not be in the path of the user. *nix checks the path first, DOS checks the path and the current directory. (I do mean checks, as DOS is still being used today, I've run 4 CNC machines that boot DOS, 2 MS-DOS and 2 DR-DOS).
I did a man exec and it seems to be a bash script executor, IIRC you had compiled the program in the original question, what impact could exec have in this situation?
When calling "exec ./myapp" the process image of the shell is replaced
with the process image of myapp which is loaded from disk. When myapp
returns the shell process is not available anymore, since it has been
replaced with myapp. You will usually not use exec with interactive
shells.
\Steve
--
Steve Graegert