*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> basename (1)              


basename(1)							   basename(1)

NAME    [Toc]    [Back]

     basename, dirname - deliver portions of pathnames

SYNOPSIS    [Toc]    [Back]

     basename string [ suffix ]
     dirname string

DESCRIPTION    [Toc]    [Back]

     basename deletes any prefix ending	in / and the suffix (if	present	in
     string) from string, and prints the result	on the standard	output.	 It is
     normally used inside substitution marks (``) within shell procedures.
     The suffix	is a pattern as	defined	on the ed(1) manual page.

     dirname delivers all but the last level of	the pathname in	string.

EXAMPLES    [Toc]    [Back]

     The following example, invoked with the argument /home/sms/personal/mail
     sets the environment variable NAME	to the filenamed mail and the
     environment variable MYMAILPATH to	the string /home/sms/personal.

	  NAME=`basename $HOME/personal/mail`
	  MYMAILPATH=`dirname $HOME/personal/mail`

     This shell	procedure, invoked with	the argument /usr/src/bin/cat.c,
     compiles the named	file and moves the output to cat in the	current

	  cc $1
	  mv a.out `basename $1	'\.c'`

FILES    [Toc]    [Back]

	  language-specific message file (See LANG on environ(5).)

SEE ALSO    [Toc]    [Back]

     ed(1), sh(1).

									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
post Tru64 deliver a message
tail IRIX deliver the last part of a file
tail HP-UX deliver the last part of a file
pthread_kill IRIX deliver a signal to a thread
cut OpenBSD select portions of each line of a file
basename HP-UX extract portions of path names
cut FreeBSD select portions of each line of a file
dirname HP-UX extract portions of path names
stdump Tru64 Dump portions of a file containing symbolic information
pathchk FreeBSD check pathnames
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service