SRC(1)

πŸ’– NAME πŸ’–

okay so welcome to SRC(1), General Commands Manual bestie β€” this page is all about src β€” find source code for executable. it’s giving detective energy for your binaries πŸ”πŸ’…

✨ SYNOPSIS ✨

src [ -n ] [ -s symbol ] file ...

πŸ¦‹ DESCRIPTION πŸ¦‹

src examines the named file ... files to find the corresponding source code, and then that source gets sent to the editor using B (see sam(1)). no cap, that’s the whole mission 🫢

  • if file is an rc(1) script, the source is the file itself. iconic, self-referential, we love her πŸ’–
  • if file is an executable, the source is defined to be the single file containing the definition of main, and src will point the editor at the line that begins the definition. main character behavior fr fr πŸ‘‘
  • src uses db(1) to extract the symbol table information that identifies the source. that’s the secret sauce 🧚

src looks for each file in the current directory, in /bin, and in the subdirectories of /bin, in that order. literally that order, bestie β€” current dir first, then /bin, then /bin’s subdirectories 🌈

options tea β˜•

  • -n β€” causes src to print the file name but not send it to the editor. print-only mode, no editor pop-up, we respect the boundary πŸ’…
  • -s symbol β€” identifies a symbol other than main to locate. you want a different symbol? say less, pass it here 🎯

🌈 EXAMPLES 🌈

find the source to the main routine in /bin/ed:

src ed

find the source for strcmp:

src -s strcmp rc

πŸŽ€ SOURCE πŸŽ€

the source path is:

/bin/src

🌸 SEE ALSO 🌸

db(1), plumb(1), sam(1).


sign-off cuteness: this is SRC(1) from the General Commands Manual, and the SOURCE is /bin/src. there’s no extra date/version line in the original footer, so I’m not inventing one β€” periodt πŸŽ€βœ¨