On Wed, 2003-06-25 at 17:50, Carsten Haitzler wrote: > > If you used `basename $0` instead of the script's name, you would > > not need to remember to fix this whenever you duplicate the script. ;) > > > > > if test $# -eq 0; then > > > echo "${usage}" 1>&2 > > that would also assume that basename is infact installed on the system... and i am > fairly sure it's only a more modern "extension" linux and bsd's carry - older > unicies don't have it. either way it's fixed :)
Oh I wouldn't be too sure about that, it's a system provided binary on my SunOS 4.0.3 box. (With the SysV option installed.) -- BASENAME(1) USER COMMANDS BASENAME(1) NAME basename, dirname - display portions of pathnames and filenames SYNOPSIS basename string [ suffix ] dirname string AVAILABILITY The dirname command is available with the System V software installation option. Refer to Installing the SunOS for information on how to install optional software. DESCRIPTION basename deletes any prefix ending in / and the suffix, if present in string. It directs the result to the standard output, and is normally used inside substitution marks (` `) within shell procedures. dirname delivers all but the last level of the path name in string. EXAMPLES 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 directory: cc $1 mv a.out `basename $1 .c` The following example will set the shell variable NAME to /usr/src/cmd: NAME=`dirname /usr/src/cmd/cat.c` SEE ALSO sh(1) Sun Release 4.0 Last change: 22 March 1989 1 -- -- Don Krause ph: 909.799.8327 Systems Administrator page: 909.512.0174 Optivus Technology, Inc e-mail: [EMAIL PROTECTED] ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ enlightenment-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel