#3629 Issue open: in Source() call apply_bash_flags_and_options_commands in any case¶
Labels: enhancement, cleanup, discuss / RFC
jsmeix opened issue at 2026-08-26 09:09:¶
In
https://github.com/rear/rear/wiki/Coding-Style#try-hard-to-care-about-possible-errors
there is
When leaving the script restore the ReaR default bash flags
and options with apply_bash_flags_and_options_commands
I am wondering why we do not do this in any case
same as we do cd "$WORKING_DIR" in any case
to ensure that after each sourced file
we are back in the ReaR working directory.
In contrast we restore the ReaR default bash flags
and options of MASTER_PID (i.e. of usr/sbin/rear)
only in DEBUGSCRIPTS mode in our Source function.
See the current master code starting at
https://github.com/rear/rear/blob/master/usr/share/rear/lib/_framework-setup-and-functions.sh#L1910
@rear/contributors
are there valid use cases where bash flags and options
are set different in one script and meant to be kept
for subsequent other scripts?
If there are such use cases I think they are special cases
and then I think it is probably better to explicitly set
non-default bash flags and options in each script where
that is needed.
In particular this makes it clear which code is run
with non-default bash flags and options compared to
when special bash flags and options get (silently)
inherited from some previous script.
[Export of Github issue for rear/rear.]