Skip to content
Snippets Groups Projects
Unverified Commit a7779e24 authored by cladmi's avatar cladmi Committed by Gaëtan Harter
Browse files

openocd.sh: handle 'newline' on osx

https://stackoverflow.com/a/24276470

    In replacement strings used with the s command, assume that NO
    control-character escape sequences are supported (ex '\n')

Replace with an escaped newline character. Current form works in 'bash'.
parent 6f02568c
No related branches found
No related tags found
No related merge requests found
......@@ -172,9 +172,12 @@ _split_banks() {
# The following command needs specific osx handling (non gnu):
# * Same commands for a pattern should be on different lines
# * Cannot use '\n' in the replacement string
local sed_escaped_newline=\\$'\n'
sed -n '
/^{.*}$/ {
s/\} /\}\n/g
s/\} /\}'"${sed_escaped_newline}"'/g
s/[{}]//g
p
}'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment