bug-coreutils
[Top][All Lists]
Advanced

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

bug#70639: Bug or Misleading Description of realpath command


From: Hazel Cooney
Subject: bug#70639: Bug or Misleading Description of realpath command
Date: Sun, 28 Apr 2024 18:37:51 -0500

Hello,
I don't know if this was my misuse of the command or whether this was a
bug, but it seems like the realpath command does not work as expected in
some cases. I have a folder in my home directory called "music_copy" and I
tried to use a command string to print the full paths to the files and
directories inside it by using the command ls music_copy | xargs realpath ,
but it didn't work as expected. I expected the output to contain the full
paths to the files, but instead realpath outputted that the files were in
/home/lakec, which they weren't. I attached a picture of the output of the
commands I used.

This might also be a documentation issue, because it seems to me like
realpath was just "tricked" because the names of the files printed by ls
didn't have enough context for realpath to figure out what the path was. If
I changed to the music_copy directory and then ran the ls | xargs realpath,
realpath gave the correct output. It might be worth saying something about
that in the man page for realpath. I haven't checked the info page yet.

To reproduce this bug, create a directory with some files in it. Then, go
to the directory that contains the one you just made. Type ls new_directory
| xargs realpath.

I am using EndeavourOS Linux (It should be called GNU/Linux but that's the
name they use) with kernel version 6.8.7-arch1-1 , ls version 9.5, xargs
version 4.9.0. and realpath version 9.5.
Here's a screenshot of the commands I used. I also have "ls" aliased to "ls
--color=auto" in the .bashrc if you're wondering.
[image: image.png]
Thank you!

PNG image


reply via email to

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