bug-coreutils
[Top][All Lists]
Advanced

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

Re: basename sucks


From: Eric Blake
Subject: Re: basename sucks
Date: Thu, 01 Feb 2007 06:12:43 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to dusan halicky on 2/1/2007 3:35 AM:
> Hi.
> 
> 
> 
> Why the hell `basename` from coreutils package cannot act like filter?

Thanks for the report.  First, a word of advice - remember the adage that
'you catch more flies with honey than vinegar'.  Your tone came across as
very demanding and sour, and that is less likely to elicit a reasonable
response.

> # echo /home/me/foo | basename
> 
> basename: too few arguments

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.  I think the idea is
worthwhile, but now someone needs to write a patch and contribute it.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFwedL84KuGfSFAYARAohbAJ9khf36GU2Ytz4yuso6nTlYn0roCwCgqV9B
VDK1G676QHKxIJ7MbsKoFbE=
=v0C9
-----END PGP SIGNATURE-----




reply via email to

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