for loop from a shell script

From: Akira OKUMURA <oxon_at_juno.phys.s.u-tokyo.ac.jp>
Date: Wed, 9 Dec 2009 14:07:31 +0900


Hello ROOTers,

Could anyone tell me how to execute this shell script properly? On my Mac, the root.exe process keeps running and occupy ~100% CPU load.



#!/bin/bash

root -l <<EOF
for(int i=0; i<10; i++){
printf("%d\n", i);
}
.q
EOF


[oxon_at_kusu ~]$ ./tmp.sh
end with '}', '@':abort > end with '}', '@':abort > 0 1
2
3
4
5
6
7
8
9 <= ROOT stops here

I know that the following change does work.

for(int i=0; i<10; i++){printf("%d\n", i);}

Thank you in advance.

Regards,

OKUMURA, Akira oxon_at_juno.phys.s.u-tokyo.ac.jp Department of Physics, The University of Tokyo 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033
TEL/FAX +81 3-5841-4173/4059
Skype : okumura.akira Received on Wed Dec 09 2009 - 06:07:44 CET

This archive was generated by hypermail 2.2.0 : Wed Dec 09 2009 - 11:50:03 CET