1*25ab49ceSschwarze.\" $OpenBSD: dirname.1,v 1.9 2014/02/16 23:09:48 schwarze Exp $ 2e733f1e1Spjanzen.\" 3e733f1e1Spjanzen.\" Copyright (c) 1990, 1993, 1994 4e733f1e1Spjanzen.\" The Regents of the University of California. All rights reserved. 5e733f1e1Spjanzen.\" 6e733f1e1Spjanzen.\" This code is derived from software contributed to Berkeley by 7e733f1e1Spjanzen.\" the Institute of Electrical and Electronics Engineers, Inc. 8e733f1e1Spjanzen.\" 9e733f1e1Spjanzen.\" Redistribution and use in source and binary forms, with or without 10e733f1e1Spjanzen.\" modification, are permitted provided that the following conditions 11e733f1e1Spjanzen.\" are met: 12e733f1e1Spjanzen.\" 1. Redistributions of source code must retain the above copyright 13e733f1e1Spjanzen.\" notice, this list of conditions and the following disclaimer. 14e733f1e1Spjanzen.\" 2. Redistributions in binary form must reproduce the above copyright 15e733f1e1Spjanzen.\" notice, this list of conditions and the following disclaimer in the 16e733f1e1Spjanzen.\" documentation and/or other materials provided with the distribution. 17f75387cbSmillert.\" 3. Neither the name of the University nor the names of its contributors 18e733f1e1Spjanzen.\" may be used to endorse or promote products derived from this software 19e733f1e1Spjanzen.\" without specific prior written permission. 20e733f1e1Spjanzen.\" 21e733f1e1Spjanzen.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22e733f1e1Spjanzen.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23e733f1e1Spjanzen.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24e733f1e1Spjanzen.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25e733f1e1Spjanzen.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26e733f1e1Spjanzen.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27e733f1e1Spjanzen.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28e733f1e1Spjanzen.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29e733f1e1Spjanzen.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30e733f1e1Spjanzen.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31e733f1e1Spjanzen.\" SUCH DAMAGE. 32e733f1e1Spjanzen.\" 33e733f1e1Spjanzen.\" @(#)dirname.1 8.2 (Berkeley) 4/18/94 34e733f1e1Spjanzen.\" 35*25ab49ceSschwarze.Dd $Mdocdate: February 16 2014 $ 36e733f1e1Spjanzen.Dt DIRNAME 1 37e733f1e1Spjanzen.Os 38e733f1e1Spjanzen.Sh NAME 39e733f1e1Spjanzen.Nm dirname 40e733f1e1Spjanzen.Nd return directory portion of pathname 41e733f1e1Spjanzen.Sh SYNOPSIS 42e733f1e1Spjanzen.Nm dirname 436304fd97Smillert.Ar pathname 44e733f1e1Spjanzen.Sh DESCRIPTION 45e733f1e1Spjanzen.Nm 46e733f1e1Spjanzendeletes the filename portion, beginning 47e733f1e1Spjanzenwith the last slash 48e733f1e1Spjanzen.Pq Sq \&/ 49e733f1e1Spjanzencharacter to the end of 506304fd97Smillert.Ar pathname , 51e733f1e1Spjanzenand writes the result to the standard output. 52f1c64ac4Sjmc.Sh EXIT STATUS 5349378797Ssobrado.Ex -std dirname 54e733f1e1Spjanzen.Sh EXAMPLES 55e733f1e1SpjanzenThe following line sets the shell variable 56e733f1e1Spjanzen.Ev FOO 57e733f1e1Spjanzento 58e733f1e1Spjanzen.Pa /usr/bin : 59e733f1e1Spjanzen.Pp 60e733f1e1Spjanzen.Dl FOO=`dirname /usr/bin/tail` 61e733f1e1Spjanzen.Sh SEE ALSO 62e733f1e1Spjanzen.Xr basename 1 , 63e733f1e1Spjanzen.Xr csh 1 , 64e733f1e1Spjanzen.Xr sh 1 , 65e733f1e1Spjanzen.Xr dirname 3 66e733f1e1Spjanzen.Sh STANDARDS 67e733f1e1SpjanzenThe 68e733f1e1Spjanzen.Nm 697c5a075bSjmcutility is compliant with the 7099332e38Sjmc.St -p1003.1-2008 717c5a075bSjmcspecification. 72*25ab49ceSschwarze.Sh HISTORY 73*25ab49ceSschwarzeThe 74*25ab49ceSschwarze.Nm 75*25ab49ceSschwarzeutility first appeared as an 76*25ab49ceSschwarze.Xr expr 1 77*25ab49ceSschwarzescript in 78*25ab49ceSschwarze.At III . 79*25ab49ceSschwarzeIt was reimplemented in C for 80*25ab49ceSschwarze.Bx 4.3 Reno 81*25ab49ceSschwarzeand reimplemented again using 82*25ab49ceSschwarze.Xr dirname 3 83*25ab49ceSschwarzefor 84*25ab49ceSschwarze.Ox 2.2 . 85*25ab49ceSschwarze.Sh AUTHORS 86*25ab49ceSschwarze.An -nosplit 87*25ab49ceSschwarzeThe original 88*25ab49ceSschwarze.Bx 89*25ab49ceSschwarzeversion was written by 90*25ab49ceSschwarze.An Keith Bostic . 91*25ab49ceSschwarzeThe current 92*25ab49ceSschwarze.Ox 93*25ab49ceSschwarzeversion was written by 94*25ab49ceSschwarze.An Todd Miller Aq Mt millert@openbsd.org . 95