* [9fans] find/locate a file
@ 2000-11-11 14:51 Ish Rattan
0 siblings, 0 replies; 5+ messages in thread
From: Ish Rattan @ 2000-11-11 14:51 UTC (permalink / raw)
To: 9fans
Is there a way to find (discover the path) of a file
in the source tree? For example, source for echo server
running on port 7 (if the name is echo.c??).
- ishwar
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9fans] find/locate a file
@ 2000-11-11 17:06 forsyth
0 siblings, 0 replies; 5+ messages in thread
From: forsyth @ 2000-11-11 17:06 UTC (permalink / raw)
To: 9fans
i ought to have added that although i used absolute names to
make it clearer which file src was examining, i could have said
src upas/smtpd
or
src smtpd
and let it hunt for it in /bin and /bin/* itself.
it actually works for scripts as well, thus
src tcp7
src tcp25
would track down the services (but you'd have had to know the naming scheme).
try
src src
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9fans] find/locate a file
@ 2000-11-11 17:00 forsyth
2000-11-11 16:10 ` Boyd Roberts
0 siblings, 1 reply; 5+ messages in thread
From: forsyth @ 2000-11-11 17:00 UTC (permalink / raw)
To: 9fans
[-- Attachment #1: Type: text/plain, Size: 794 bytes --]
for compiled executables, try src(1).
in this particular case, however, the services are implemented by shell scripts.
see listen(8) for details, but they are found in /rc/bin/service and /rc/bin/service.auth,
in files named using an obvious naming scheme (eg, /rc/bin/service/tcp7).
term% cat /bin/service/tcp7
#!/bin/rc
/bin/cat
so much for that one. others such as tcp25 invoke specialised commands
with appropriate argument shuffling:
term% cat /bin/service/tcp25
#!/bin/rc
#smtp serv net incalldir user
user=`{cat /dev/user}
exec upas/smtpd -n $3
and then you can do
src /bin/upas/smtpd
to pop the source of the command into an acme frame, or use
src -n just to print the name:
term% src -n /bin/upas/smtpd
/sys/src/cmd/upas/smtp/smtpd.c:71
[-- Attachment #2: Type: message/rfc822, Size: 1736 bytes --]
From: Ish Rattan <ishwar@pali.cps.cmich.edu>
To: 9fans@cse.psu.edu
Subject: [9fans] find/locate a file
Date: Sat, 11 Nov 2000 09:51:04 -0500 (EST)
Message-ID: <Pine.BSF.4.21.0011110949080.18795-100000@pali.cps.cmich.edu>
Is there a way to find (discover the path) of a file
in the source tree? For example, source for echo server
running on port 7 (if the name is echo.c??).
- ishwar
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9fans] find/locate a file
2000-11-11 17:00 forsyth
@ 2000-11-11 16:10 ` Boyd Roberts
0 siblings, 0 replies; 5+ messages in thread
From: Boyd Roberts @ 2000-11-11 16:10 UTC (permalink / raw)
To: 9fans
From: <forsyth@caldo.demon.co.uk>
> for compiled executables, try src(1).
what?!? there isn't a perl script for it?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9fans] find/locate a file
@ 2000-11-11 15:02 nigel
0 siblings, 0 replies; 5+ messages in thread
From: nigel @ 2000-11-11 15:02 UTC (permalink / raw)
To: 9fans
[-- Attachment #1: Type: text/plain, Size: 197 bytes --]
One might normally use the src(1) command,
however,
src echo
finds the source to the echo(1) command.
cat /rc/bin/service/tcp7
shows the real command for tcp echo. It its cat(1).
[-- Attachment #2: Type: message/rfc822, Size: 1448 bytes --]
From: Ish Rattan <ishwar@pali.cps.cmich.edu>
To: 9fans@cse.psu.edu
Subject: [9fans] find/locate a file
Date: Sat, 11 Nov 2000 09:51:04 -0500 (EST)
Message-ID: <Pine.BSF.4.21.0011110949080.18795-100000@pali.cps.cmich.edu>
Is there a way to find (discover the path) of a file
in the source tree? For example, source for echo server
running on port 7 (if the name is echo.c??).
- ishwar
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2000-11-11 17:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-11 14:51 [9fans] find/locate a file Ish Rattan
2000-11-11 15:02 nigel
2000-11-11 17:00 forsyth
2000-11-11 16:10 ` Boyd Roberts
2000-11-11 17:06 forsyth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).