which(3f) - [M_io:ENVIRONMENT] given a command name find the pathname by searching the directories in the environment variable $PATH (LICENSE:PD)
Syntax
Description
Options
Returns
Example
Author
License
function which(command) result(pathname)
character(len=*),intent(in) :: command character(len=:),allocatable :: pathname
Given a command name find the first file with that name in the directories specified by the environment variable $PATH.
COMMAND the command to search for
PATHNAME the first pathname found in the current user path. Returns blank if the command is not found.
Sample program:
program demo_which use M_io, only : which implicit none write(*,*)ls is ,which(ls) write(*,*)dir is ,which(dir) write(*,*)install is ,which(install) end program demo_which
John S. Urban
Public Domain
which (3) | March 11, 2021 |