home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: eval Chapter 4
The Bourne Shell and Korn Shell
Next: Reference: exit
 

exec



exec

 [

command

]

Execute command in place of the current process (instead of creating a new process). exec is also useful for opening, closing, or copying file descriptors.

Examples


trap 'exec 2>&-' 0	
Close standard error when 

	
shell script exits (signal 0).

$ 

exec /bin/csh

	
Replace Bourne shell with C shell.

$ 

exec < infile

	
Reassign standard input to infile.


Previous: Reference: eval UNIX in a Nutshell: System V Edition Next: Reference: exit
Reference: eval Book Index Reference: exit

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System