Changed echo usage for printf as it is more portable.