basename.1 (d628d776c45a0e11a0a035597d49023942501ecc) basename.1 (3898680cf705cef4e1cc606b44cd91fc4252bcd5)
1.\" Copyright (c) 1990, 1993, 1994
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Institute of Electrical and Electronics Engineers, Inc.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions

--- 34 unchanged lines hidden (view full) ---

43.Nd return filename or directory portion of pathname
44.Sh SYNOPSIS
45.Nm
46.Ar string
47.Op Ar suffix
48.Nm dirname
49.Ar string
50.Sh DESCRIPTION
1.\" Copyright (c) 1990, 1993, 1994
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Institute of Electrical and Electronics Engineers, Inc.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions

--- 34 unchanged lines hidden (view full) ---

43.Nd return filename or directory portion of pathname
44.Sh SYNOPSIS
45.Nm
46.Ar string
47.Op Ar suffix
48.Nm dirname
49.Ar string
50.Sh DESCRIPTION
51.Nm Basename
52deletes any prefix ending with the last slash
51The
52.Nm
53utility deletes any prefix ending with the last slash
53.Ql \&/
54character present in
55.Ar string
56(after first stripping trailing slashes),
57and a
58.Ar suffix ,
59if given.
60The
61.Ar suffix
62is not stripped if it is identical to the remaining characters in
63.Ar string .
64The resulting filename is written to the standard output.
65A non-existent suffix is ignored.
66.Pp
54.Ql \&/
55character present in
56.Ar string
57(after first stripping trailing slashes),
58and a
59.Ar suffix ,
60if given.
61The
62.Ar suffix
63is not stripped if it is identical to the remaining characters in
64.Ar string .
65The resulting filename is written to the standard output.
66A non-existent suffix is ignored.
67.Pp
67.Nm Dirname
68deletes the filename portion, beginning
68The
69.Nm dirname
70utility deletes the filename portion, beginning
69with the last slash
70.Ql \&/
71character to the end of
72.Ar string
73(after first stripping trailing slashes),
74and writes the result to the standard output.
75.Sh EXAMPLES
76The following line sets the shell variable

--- 7 unchanged lines hidden (view full) ---

84.Sh SEE ALSO
85.Xr csh 1 ,
86.Xr sh 1
87.Sh STANDARDS
88The
89.Nm
90and
91.Nm dirname
71with the last slash
72.Ql \&/
73character to the end of
74.Ar string
75(after first stripping trailing slashes),
76and writes the result to the standard output.
77.Sh EXAMPLES
78The following line sets the shell variable

--- 7 unchanged lines hidden (view full) ---

86.Sh SEE ALSO
87.Xr csh 1 ,
88.Xr sh 1
89.Sh STANDARDS
90The
91.Nm
92and
93.Nm dirname
92functions are expected to be
94utilities are expected to be
93.St -p1003.2
94compatible.
95.St -p1003.2
96compatible.