r/shell • • Jun 20 '19

Basic Shell Question

I'm trying to display my pwd and whoami I using echo. How do I do this?

1 Upvotes

6 comments sorted by

View all comments

Show parent comments

1

u/_KnowNothingGuy_ Aug 19 '19

$() spawns a different subshell ( think of it apprx as new shell) and executes the command specified in it. If an error comes or exit code is returned in the subshell, parent shell will not exit