Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    See Grouping Commands under 2.9.4 Compound Commands Commented Mar 4, 2016 at 17:10
  • 3
    try inserting exit ; between the du. Commented Mar 4, 2016 at 17:10
  • This is the closest answer I found in the web. The exact issue has not been explained in this site. Commented Mar 4, 2016 at 18:30
  • 2
    Both of them are Grouping Commands, but { list; } executes commands in current shell environment. Commented Mar 4, 2016 at 18:31
  • @Archemar Interesting that if pipe is used the current shell will not be closed. Example: ( echo 1; exit; echo 2; ) | less. In less will be shown 1. Checked in bash shell. Commented Apr 9, 2024 at 12:56