Skip to content

Commit 80caf73

Browse files
authored
Replace echo -e and echo -n with printf for macOS compatibility (#2759)
* Replace echo with printf for hostname processing in DNS configuration Signed-off-by: Sophie Shen <syc_libra@live.cn> * use printf for print_usage function Signed-off-by: Sophie Shen <syc_libra@live.cn> --------- Signed-off-by: Sophie Shen <syc_libra@live.cn>
1 parent 612f7cf commit 80caf73

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

checker_tool/check_cpfs.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ function print_usage() {
8383
echo "Usage: ${script_name} [OPTIONS]..."
8484
echo ""
8585
echo "Accepted cli arguments are:"
86-
echo -e "\t[--help|-h], prints this help."
87-
echo -e "\t[--all|-a], all cases will be ran."
88-
echo -e "\t[--groups|-g <groups>], the case groups should be like --groups='group1,group2'."
89-
echo -e "\t[--groups|-g -l], list the current supported groups."
90-
echo -e "\t[--ignore-groups|-ng <groups>], skip the cases groups, like -ng group1,group2."
91-
echo -e "\t[--cases|-c <cases>], the cases should be like --cases='case1,case2'."
92-
echo -e "\t[--cases|-c -l], list the current supported cases."
93-
echo -e "\t[--ignore-cases|-nc <cases>], skip the cases groups, like -nc case1,case2."
94-
echo -e "\t[--output-file|-f <string>], name to use for the output file. Default name is 'results.json'"
86+
printf '%b\n' "\t[--help|-h], prints this help."
87+
printf '%b\n' "\t[--all|-a], all cases will be ran."
88+
printf '%b\n' "\t[--groups|-g <groups>], the case groups should be like --groups='group1,group2'."
89+
printf '%b\n' "\t[--groups|-g -l], list the current supported groups."
90+
printf '%b\n' "\t[--ignore-groups|-ng <groups>], skip the cases groups, like -ng group1,group2."
91+
printf '%b\n' "\t[--cases|-c <cases>], the cases should be like --cases='case1,case2'."
92+
printf '%b\n' "\t[--cases|-c -l], list the current supported cases."
93+
printf '%b\n' "\t[--ignore-cases|-nc <cases>], skip the cases groups, like -nc case1,case2."
94+
printf '%b\n' "\t[--output-file|-f <string>], name to use for the output file. Default name is 'results.json'"
9595
echo ""
9696
}
9797

preload_data.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ data:
522522
523523
[alt_names]
524524
525-
DNS.1 = \$(echo -n "\$my_hostname" | sed s/-[0-9]*\$//)
525+
DNS.1 = \$(printf '%s' "\$my_hostname" | sed s/-[0-9]*\$//)
526526
527527
DNS.2 = \$my_hostname
528528
@@ -1536,7 +1536,7 @@ data:
15361536
15371537
[alt_names]
15381538
1539-
DNS.1 = \$(echo -n "\$my_hostname" | sed s/-[0-9]*\$//)
1539+
DNS.1 = \$(printf '%s' "\$my_hostname" | sed s/-[0-9]*\$//)
15401540
15411541
DNS.2 = \$my_hostname
15421542

0 commit comments

Comments
 (0)