tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
15
Task/Environment-variables/Fortran/environment-variables.f
Normal file
15
Task/Environment-variables/Fortran/environment-variables.f
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
program show_home
|
||||
implicit none
|
||||
character(len=32) :: home_val ! The string value of the variable HOME
|
||||
integer :: home_len ! The actual length of the value
|
||||
integer :: stat ! The status of the value:
|
||||
! 0 = ok
|
||||
! 1 = variable does not exist
|
||||
! -1 = variable is not long enought to hold the result
|
||||
call get_environment_variable('HOME', home_val, home_len, stat)
|
||||
if (stat == 0) then
|
||||
write(*,'(a)') 'HOME = '//trim(home_val)
|
||||
else
|
||||
write(*,'(a)') 'No HOME to go to!'
|
||||
end if
|
||||
end program show_home
|
||||
Loading…
Add table
Add a link
Reference in a new issue