program main implicit none character(1), parameter :: esc = achar(27) character(1), parameter :: cr = achar(13) integer, parameter :: stdout = 6 integer :: i write(stdout,*) do i = 1, 10 write(stdout,"(a)",advance='no') esc//'M' write(stdout,"(i0)") i call sleep(1) enddo end program main