#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
- Author
- Joachim Wiberg
- Date
- 2017-2021
- Copyright
- ISC License
◆ which()
char* which |
( |
const char * |
cmd | ) |
|
Like which(1), or command -v foo
- Parameters
-
cmd | Command to look for in $PATH |
- Returns
- A malloc()'ed path to cmd on success, or
NULL
.
◆ whichp()
int whichp |
( |
const char * |
cmd | ) |
|
Predicate variant of which()
- Parameters
-
cmd | Command to look for in $PATH |
- Returns
TRUE(1)
or FALSE(0)
if cmd
exists in $PATH.