mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
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'.
This commit is contained in:
parent
6f02568c84
commit
a7779e24c5
5
dist/tools/openocd/openocd.sh
vendored
5
dist/tools/openocd/openocd.sh
vendored
@ -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
|
||||
}'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user