-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Problem
I use protections in all bash scripts to prevent bugs. Bash protection of set -eu for unbound variables errors out when sourcing a ROS environment. With complicated shell scripts, -eu is used in CI to ensure all variables used are defined.
Steps to reproduce
set -eu
source /opt/ros/humble/setup.bash
>> Terminal closesLogs
$ set -u
$ source /opt/ros/humble/setup.bash
>>> bash: AMENT_TRACE_SETUP_FILES: unbound variable
Environment
- Ubuntu 22.04
- ROS 2 Humble (binaries)
Workaround
# My long script
# Add protection
set -euf -o pipefail
echo foo
echo bar
# lots of other custom code here
set +u # temporary disable protection
source /opt/ros/humble/setup.bash
set -u # re-enable protection
# more custom code heremikestaub
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed