GNU bug report logs - #14023
dirname/basename unexpected results when run by xargs -I

Previous Next

Package: coreutils;

Reported by: Juho-Pekka Kuitunen <artanicus <at> mythmardyl.org>

Date: Fri, 22 Mar 2013 00:37:04 UTC

Severity: normal

Tags: moreinfo

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juho-Pekka Kuitunen <artanicus <at> mythmardyl.org>
To: bug-coreutils <at> gnu.org
Subject: dirname/basename unexpected results when run by xargs -I
Date: Thu, 21 Mar 2013 18:36:21 +0200
Reproduce example;
$ echo "testdir/testfile" | xargs -I '{}' echo '{}', dir: $(echo
dirname '{}') = $(dirname '{}')

Expected output;
testdir/testfile, dir: dirname testdir/testfile = testdir

Actual output;
testdir/testfile, dir: dirname testdir/testfile = .

This behavior seems to be limited to the xargs -I replace-str usage
pattern, any other way I can think of running dirname works fine.
Basename has similarly wonky behavior, it prints the full string
instead of doing any stripping.

Not sure if there's a bug involved (or if it's on the findutils or
coreutils side). Could also just be something silly I'm overlooking.
I've tested this with findutils 4.4.2 and coreutils 8.5 & 8.13 with
identical results.

--
Juho-Pekka Kuitunen




This bug report was last modified 12 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.