SHTOOL-PATH.TMP(1)
π SHTOOL-PATH.TMP(1) π
ok so this is the GNU Portable Shell Tool girlies, and this specific page is all about shtool-path β yes bestie, the manual is literally called SHTOOL-PATH.TMP(1) and it lives in section 1. pull up a chair π«Ά
β¨ NAME β¨
shtool-path β the GNU shtool command that deals with shell path variables π¦
πΈ SYNOPSIS πΈ
shtool path [-s|--suppress] [-r|--reverse] [-d|--dirname]
[-b|--basename] [-m|--magic] [-p|--path path] str [str ...]
π DESCRIPTION π
ok so this command is literally the moment for shell $PATH variables. it can find a program by looking through one or more filenames that you hand it as one or more str arguments. then it prints the absolute filesystem path to that program on "stdout" β and it gives you an exit code of 0 if the thing was really, actually found. no cap. β¨
π OPTIONS π
these are the command line options available, bestie. all of them. every single one. periodt.
-s,--suppressβ suppresses output entirely. super useful when you only wanna test whether a program exists, using the return code as your answer. iykyk π₯-r,--reverseβ transforms a forward path to a subdirectory into a reverse path. flip it and reverse it π«-d,--dirnameβ outputs the directory name of str.-b,--basenameβ outputs the base name of str.-m,--magicβ enables the advanced magic search for"perl"and"cpp". it's giving wizardry π§-p,--pathpath β search in path. the default is to search in$PATH.
π EXAMPLE π
here's a little shell script moment for u:
# shell script
awk=`shtool path -p "${PATH}:." gawk nawk awk`
perl=`shtool path -m perl`
cpp=`shtool path -m cpp`
revpath=`shtool path -r path/to/subdir`
π HISTORY π
the GNU shtool path command was originally written by Ralf S. Engelschall <rse@engelschall.com> back in 1998 for Apache. it was later taken over into GNU shtool. a whole origin story, honestly. π
β SEE ALSO β
ngl this page is from shtool 2.0.8, dated 18-Jul-2008. slay, iconic, and it's the GNU Portable Shell Tool. bye bestie, go find ur programs πππ
π¦ where this page comes from
- debian bookworm: shtool 2.0.8-10 Β· GPL-2.0-or-later
- debian trixie: shtool 2.0.8-10 Β· GPL-2.0-or-later
- ubuntu jammy: shtool 2.0.8-10 Β· GPL-2.0-or-later
- ubuntu noble: shtool 2.0.8-10 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms