convert shell script to using register variable

Signed-off-by: Kouhei Maeda <mkouhei@palmtb.net>