aboutsummaryrefslogtreecommitdiff
path: root/man/man1/src.1
blob: 5f6a29cffa0323d59771bf5e9770b10f3fa71da4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.TH SRC 1 
.SH NAME
src  \- find source code for executable
.SH SYNOPSIS
.B src
[
.B -n
]
[
.B -s
.I symbol
]
.I file
.B ...
.SH DESCRIPTION
.I Src
examines the named
.I files
to find the corresponding source code, which is then sent to the editor using
.B B
(see
.IR sam (1)).
If
.I file
is an
.IR rc (1)
script, the source is the file itself.
If
.I file
is an executable, the source is defined to be the single file containing the
definition of
.B main
and
.I src
will point the editor at the line that begins the definition.
.I Src
uses
.IR db (1)
to extract the symbol table information that identifies the source.
.PP
.I Src
looks for each
.I file
in the current directory, in
.BR /bin ,
and in the subdirectories of
.BR /bin ,
in that order.
.PP
The
.B -n
flag causes
.B src
to print the file name but not send it to the editor.
The
.B -s
flag identifies a
.I symbol
other than
.B main
to locate.
.SH EXAMPLES
Find the source to the
.B main
routine in
.BR /bin/ed :
.IP
.EX
src ed
.EE
.PP
Find the source for
.BR strcmp :
.IP
.EX
src -s strcmp rc
.EE
.SH SOURCE
.B \*9/bin/src
.SH "SEE ALSO"
.IR db (1),
.IR plumb (1),
.IR sam (1).