I've just recently come across 'exec' in a few scripts.  No familiarity with it.  Running this:

echo before exec
exec echo exec itself
echo after exec

... I find that whether in a script or a function it zaps the terminal and there's no such place as 'after exec'. What are the uses of that?  For example the script that starts xfce4 'etc/xdg/xfce4/xinitrc' ends with this:

     exec xfce4-session

... so 'then what'?  Hard to put the question into words, but I have a sort of hanging feeling, I don't know where execution goes.  For that matter, neither do the xfce4 people know where it goes.  ( Micro rant: you have yer systemd and yer xdg and yer dbus and God knows what else all layered on top of each other and nobody knows what's actually happening.) The question arises cuz I want to run scripts both just before and just after an xfce4 session but nobody knows how that might be done.  Not our problem here of course, but if I had some insights into 'exec' it might help.  When, where and why do we 'exec' things?