C Library Functions - which (3)
NAME
which(3f) - [M_io:SCANNAMES] given a command name find the pathname
by searching the directories in the environment variable
$PATH
(LICENSE:PD)
CONTENTS
Syntax
Description
Options
Returns
Examples
See Also
Author
License
SYNTAX
function which(command) result(pathname)
character(len=*),intent(in) :: command
character(len=:),allocatable :: pathname
DESCRIPTION
Given a command name find the first file with that name in the directories
specified by the environment variable $PATH.
OPTIONS
|
COMMAND |
| |
the command to search for
|
|
RETURNS
|
PATHNAME |
| |
the first pathname found in the current user path. Returns blank
if the command is not found.
|
|
EXAMPLES
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
SEE ALSO
M_system:system_dir(3f)
AUTHOR
John S. Urban
LICENSE
Public Domain
| Nemo Release 3.1 | which (3) | June 29, 2025 |
Generated by manServer 1.08 from 0e638282-8759-4fc3-b3f3-1bd1a3c555ba using man macros.