Save output into file bash scripting

edited
wrongly posted.