to using shell arithmetic, which should be more light-weight and should not pose a danger of hanging.