CxxxxxCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCcccccccc program testit character*256 line write(*,'(a)')'____________________________________________________' write(*,'(a)')'| |' write(*,'(a)')'| TEST OF JUCMD(3f) COMMAND INPUT EDITOR |' write(*,'(a)')'| |' write(*,'(a)')'| Enter a few commands to be passed to the shell |' write(*,'(a)')'| and then enter "r" or "r r_command" on the input |' write(*,'(a)')'| line to go into history edit mode. |' write(*,'(a)')'| once in history edit mode you may enter |' write(*,'(a)')'| "?" to get some help. |' write(*,'(a)')'| Enter the command "quit" to exit |' write(*,'(a)')'|__________________________________________________|' 1 continue call getline(line) if(line.eq.'quit')then C ! exit program if user enters "quit" stop endif C ! now call user code to process new line of data C ! As an example, call the system shell C ! C ! common f77+ extension passes line as command to system shell call system(line(:len_trim(line))) C !call execute_command_line(line(:len_trim(line))) ! f08 equivalent goto 1 end CxxxxxCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCcccccccc subroutine getline(line) character*256 line C ! f77 extension to print prompt and stay on line write(*,'(a$)')'redo>' C !write(*,'(a)',advance='no')'redo>' ! f90+ equivalent read(*,'(a)',err=2,iostat=ios) line if(line(1:1).eq.'!')then line='r '//line(2:254) endif call jucmd(line) 2 continue return end CxxxxxCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCcccccccc