I have a variable in my shell script which is not getting resolved properly at run time:
Input
#!/bin/sh
SERVER_ERL_ARGS="+K true +A30 +P 1048576 \
-kernel inet_default_connect_options [{nodelay,true}]"
echo ${SERVER_ERL_ARGS}
Output:
+K true +A30 +P 1048576 -kernel inet_default_connect_options a
Any reason behind this kind of behavior and how can I correct it.
a [true]? I would suppose the[{nodelay,true}]to first expand to[nodelay] [true], then the first pattern is replaced bya, but the second will either get replaced by any file calledt,r,uoreor remain as[true], if no file did match. Wrong? – Philippos Oct 11 '17 at 13:26echo [{nodelay,true}]andv='[{nodelay,true}]'; echo $v. – Kusalananda Oct 11 '17 at 13:36(t)cshandzsh, you also need${var}in things like$var[text]or$var:text. – Stéphane Chazelas Jul 25 '18 at 07:49