replace echo with printf for better compat