SHTOOL-PATH.TMP(1)

πŸ“¦
version 2.0.8 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– 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, --path path β€” 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 ⭐

shtool(1), which(1).


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