Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@casperklein
Copy link
Member

@casperklein casperklein commented Aug 18, 2024

Description

  • Add some comments.
  • shopt -s inherit_errexit does not seem to serve a function without set -e beeing used. Therefor it can be safely removed?

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change that does improve existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary, I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added information about changes made in this PR to CHANGELOG.md

@casperklein casperklein self-assigned this Aug 18, 2024
@casperklein casperklein added this to the v15.0.0 milestone Aug 18, 2024
@casperklein casperklein added area/scripts kind/improvement Improve an existing feature, configuration file or the documentation labels Aug 18, 2024
@casperklein casperklein marked this pull request as ready for review August 18, 2024 09:33
Copy link
Member

@polarathene polarathene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know much about this, so I trust you two 😄

@polarathene polarathene changed the title Add comments and remove 'inherit_errexit' from start-mailserver.sh chore: Add comments and remove 'inherit_errexit' from start-mailserver.sh Aug 18, 2024
@polarathene polarathene changed the title chore: Add comments and remove 'inherit_errexit' from start-mailserver.sh chore: Add comments to start-mailserver.sh and stop using inherit_errexit Aug 18, 2024
@casperklein
Copy link
Member Author

shopt -s inherit_errexit is like set -e but for sub-shells. Using set -e is mandatory for inherit_errexit to work.

#!/bin/bash

set -o errexit # same as 'set -e'
shopt -s inherit_errexit

echo "$(command-not-exist; echo 'This message is not displayed')"

If you comment/remove the "shopt" line, the message is displayed.

@casperklein casperklein merged commit ab2127b into docker-mailserver:master Aug 18, 2024
@casperklein casperklein deleted the start-mailserver.sh branch August 18, 2024 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/scripts kind/improvement Improve an existing feature, configuration file or the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants