Skip to content

Replace echo -e and echo -n with printf for macOS compatibility#2759

Merged
Daniel-Fan merged 2 commits intoIBM:scripts-devfrom
YCShen1010:echo
Mar 4, 2026
Merged

Replace echo -e and echo -n with printf for macOS compatibility#2759
Daniel-Fan merged 2 commits intoIBM:scripts-devfrom
YCShen1010:echo

Conversation

@YCShen1010
Copy link
Contributor

What this PR does / why we need it:
Some versions of macOS zsh do not recognize echo -e or echo -n flags, causing literal -e or -n to be printed in the output instead of the intended behavior.
Replaces all occurrences across the repo with their POSIX-portable printf equivalents:

echo -e → printf '%b\n'
echo -n → printf '%s'

Which issue(s) this PR fixes:
Fixes # https://github.ibm.com/IBMPrivateCloud/roadmap/issues/68532

Signed-off-by: Sophie Shen <syc_libra@live.cn>
Signed-off-by: Sophie Shen <syc_libra@live.cn>
Copy link
Contributor

@Daniel-Fan Daniel-Fan left a comment

Choose a reason for hiding this comment

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

Thank you @YCShen1010

The test result looks positive!

✗ ./checker_tool/check_cpfs.sh --help
This is the main function
OPERATOR_NS is not set, use default namespace: ibm-common-services
You can set OPERATOR_NS by using the following command 'export OPERATOR_NS=<namespace>' 
Usage: check_cpfs.sh [OPTIONS]...

Accepted cli arguments are:
        [--help|-h], prints this help.
        [--all|-a], all cases will be ran.
        [--groups|-g <groups>], the case groups should be like --groups='group1,group2'.
        [--groups|-g -l], list the current supported groups.
        [--ignore-groups|-ng <groups>], skip the cases groups, like -ng group1,group2.
        [--cases|-c <cases>], the cases should be like --cases='case1,case2'.
        [--cases|-c -l], list the current supported cases.
        [--ignore-cases|-nc <cases>], skip the cases groups, like -nc case1,case2.
        [--output-file|-f <string>], name to use for the output file. Default name is 'results.json'

@Daniel-Fan Daniel-Fan merged commit 80caf73 into IBM:scripts-dev Mar 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants