How can I pass brackets ('{' and '}') with a shell command to get normal result? They are immediately expanded by Automatic as script code, but I need to pass them to shell as normal bracket symbols..
Command is: "set -- `cat /proc/meminfo`; echo $(($5+${11}))".
It must normally get free RAM (as I said, it does not work in Automagic because ${11} must expand into 11-th field (a shell variable), not in constant 11). This is not unique situation, there are too many shell-commands that do not work because of that behavior.
Can someone tell me how can I fix this problem with shell scripts?
P.S.: Help contains nothing about that problem.
P.P.S.: It even will not work if I will compile the command into a variable with script action like this: "cmd = "set -- `cat /proc/meminfo`; echo $(($5+$\{11\}))"". Is this all a bug or can I make this all to execute correctly?
Passing a bracket to a shell
Moderator: Martin
Re: Passing a bracket to a shell
Hi,
Variables in curly braces are replaced before the command is executed.
A similar topic was discussed here:
http://automagic4android.com/forum/view ... 364#p17337
Regards,
Martin
Variables in curly braces are replaced before the command is executed.
A similar topic was discussed here:
http://automagic4android.com/forum/view ... 364#p17337
Regards,
Martin