Q:

sed behavior on cygwin inconsistent

i have been facing an issue with a certain sed expression working on one windows system and breaking on other. The shell script is being run on cygwin, where the cygwin and sed versions are identical.
expression: 
url=$(echo ${!1} | sed 's/{/\\\{/g'); \

error on the system is :
Error: /usr/bin/sed: -e expression #1, char 2: unterminated `s' command

So when i use it by escaping the braces it works: 
url=$(echo ${!1} | sed 's/\{/\\\{/g'); \

But the breaks on the other with error saying: 
sed: -e expression #1, char 11: Invalid preceding regular expression

Please help .. stuck with this for some time. Please let me know if you need more details.

A:

for a substitution by \{
echo ${!1} | sed -e 's/{/\\{/g'

or by \\{
echo ${!1} | sed -e 's/{/\\\\{/g')

3 \ and no explicit -e are certainly the problem.
Info: No error with your code on my cygwin (usinf a direct string in place of ${!1}
If you escape the first {, sed is waiting for a number of occurence regex and an closing brace (ex: \{1,\})

