bug-coreutils
[Top][All Lists]
Advanced

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

Re: basename sucks


From: Alfred M. Szmidt
Subject: Re: basename sucks
Date: Thu, 1 Feb 2007 14:21:48 +0100 (CET)

   Hmm - making basename (and also dirname) a filter is compatible
   with POSIX: since POSIX requires a single argument, we can define
   operation with a missing argument however we want (or in other
   words, our current definition of issuing an error is not mandated).
   If we do that, then we would also need to add something like xargs'
   -0 option, so that you could filter on NUL terminated (rather than
   whitespace-terminated) strings for safety when operating on
   arbitrary file names.

You won't be able to specify the suffix to remove if it is going to
behave like a filter, unless you add a option for that.

$ echo foo.h | basename --suffix=.h
foo
$




reply via email to

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