~/ learn/ comp-325/ cards/ A descriptor is a slot you can rebind
1 of 10

Role one: replace the shell, or only a subshell

Role one: replace the shell, or only a subshell

Answer

exec date ( exec date ) echo still here

The first line ends the shell that runs it. Inside parentheses only the subshell is overlaid, so the third line still runs — which is why you can test this at all.

S&K 3e ch13 §13.5; descriptor forms and exec from POSIX.1-2024 §2.7, §2.14

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/1d88718a-f7cc-4196-bf20-abb10cd1b197/flashcard utf-8 LF