Hello all,
First I’ve just discovered SublimeText a few days ago, and use it as a basic end-user.
I have troubles to find the way to make this code with proper syntax highlighting:
#!/bin/bash
declare -a substring=( "11" "22" "33" )
declare -a replacement=( "44" "55" "66" )
TEXT="11 and 22"
for (( i=0 ; i<${#substring*]} ; i++ )); do
if ( `echo ${TEXT} | grep "${substring$i]}" 1>/dev/null 2>&1` ); then
TEXT=${TEXT//"${substring$i]}"/"${replacement$i]}"};
fi
done
echo $TEXT
I feel that ShellScript.sublime-package needs adjustment or a custom syntax definition needs to be added but haven’t succeed to find the good syntax.
Thanks in advance if you could give me some track.
Edition : to clarify, this line cause the syntax highlighting to stop : TEXT=${TEXT//"${substring$i]}"/"${replacement$i]}"};
if double quotes from 1st argument ( ${substring$i]} ) are removed, it is OK
Edition2 : changed title with [solved], added “nested braces” in title