Garbled outcome from Cling

Hi, Jakob:

Thank you for your answer, one further question is if I write those lines in a script and then run the script with root, I can get the correct answer. What causes the difference?

Best