3 ! Check that we accept all variants of the EXECUTE_COMMAND_LINE intrinsic.
6 character(len
=100) :: s
10 call execute_command_line ("ls *.f90")
12 print *, "-----------------------------"
14 call execute_command_line ("sleep 1 ; ls *.f90", .false
.)
15 print *, "I'm not waiting"
18 print *, "-----------------------------"
20 call execute_command_line ("sleep 1 ; ls *.f90", .true
.)
24 print *, "-----------------------------"
26 call execute_command_line ("ls *.f90", .true
., i
)
27 print *, "Exist status was: ", i
29 print *, "-----------------------------"
31 call execute_command_line ("ls *.doesnotexist", .true
., i
)
32 print *, "Exist status was: ", i
34 print *, "-----------------------------"
36 call execute_command_line ("echo foo", .true
., i
, j
)
37 print *, "Exist status was: ", i
38 print *, "Command status was: ", j
40 print *, "-----------------------------"
42 call execute_command_line ("echo foo", .true
., i
, j
, s
)
43 print *, "Exist status was: ", i
44 print *, "Command status was: ", j
45 print *, "Error message is: ", trim(s
)
47 print *, "-----------------------------"
49 call execute_command_line ("ls *.doesnotexist", .true
., i
, j
, s
)
50 print *, "Exist status was: ", i
51 print *, "Command status was: ", j
52 print *, "Error message is: ", trim(s
)
54 print *, "-----------------------------"
56 call execute_command_line ("sleep 20", .false
.)
57 print *, "Please kill me with ^C"