diff --git a/colcon_core/shell/sh.py b/colcon_core/shell/sh.py index cfab571f..95553d83 100644 --- a/colcon_core/shell/sh.py +++ b/colcon_core/shell/sh.py @@ -28,10 +28,8 @@ class ShShell(ShellExtensionPoint): FORMAT_STR_USE_ENV_VAR = '${name}' FORMAT_STR_INVOKE_SCRIPT = 'COLCON_CURRENT_PREFIX="{prefix}" ' \ '_colcon_prefix_sh_source_script "{script_path}"' - FORMAT_STR_REMOVE_LEADING_SEPARATOR = 'if [ "$(echo -n ${name} | ' \ - 'head -c 1)" = ":" ]; then export {name}=${{{name}#?}} ; fi' - FORMAT_STR_REMOVE_TRAILING_SEPARATOR = 'if [ "$(echo -n ${name} | ' \ - 'tail -c 1)" = ":" ]; then export {name}=${{{name}%?}} ; fi' + FORMAT_STR_REMOVE_LEADING_SEPARATOR = 'export {name}=${{{name}#:}}' + FORMAT_STR_REMOVE_TRAILING_SEPARATOR = 'export {name}=${{{name}%:}}' def __init__(self): # noqa: D107 super().__init__()