subroutine unwrap_tgz use precision_def implicit none character*200 string character*50 tgz_file integer ios string = 'ls'//' output*.tgz > unwrap.dat' print *,string call execute_command_line(string) ios=0 open(unit=5, file = 'unwrap.dat') do while(ios == 0) read(5,'(a)',iostat=ios)tgz_file print *, tgz_file if(ios== 0)then string = 'tar -xzf '//trim(tgz_file) print *,trim(string) call execute_command_line(string) end if end do close(unit=5) end subroutine