bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shorthand attempt at 'basename file .ext'


From: Eric Blake
Subject: Re: shorthand attempt at 'basename file .ext'
Date: Fri, 28 Mar 2008 15:18:53 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Chris F.A. Johnson <cfajohnson <at> gmail.com> writes:

> 
>    You can find a shell function to replace the external basename
>    command at: <http://cfaj.freeshell.org/shell/scripts/basename-sh>.

Except that your example is not POSIX-compliant.  POSIX requires
'basename -- -a' to print '-a', not '--'.

Also, on platforms where // is special (such as cygwin), 'basename //' 
and 'basename // /' should print '//', not '/', to match the behavior of the 
basename program on those platforms.

-- 
Eric Blake






reply via email to

[Prev in Thread] Current Thread [Next in Thread]