[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how is "exec" executed by a shell?



hi list,

I was wondering how does a shell execute a "exec" command?
just like any other command i guess....but i have a samll doubt
on it's behaviour......

i did...

$ exec man

The shell closed!

$ exec man &
[1] 10618
$ What manual page do you want?
 
[1]+  Exit 1                  exec man
$

The man page of exec says....
"If  command is specified, it replaces the shell."

But does'nt the shell "wait" for whatever command is given to it
to complete???....little confused here. Moreover

$ exec exit
bash: exec: exit: not found

did not work! is'nt "exit" also a command?

TIA,
-mandeep

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/