[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Listing the files of a package output
From: |
Guillaume Le Vaillant |
Subject: |
Re: Listing the files of a package output |
Date: |
Tue, 20 Jun 2023 16:53:01 +0000 |
Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:
> Hi Guix,
>
> this looks like a beginner's question, but I can't figure out how to do
> this: list the files in a given package output, from the command line (I
> do know how to do this in Guile).
>
> For a package with a single output, I can do
>
> ls -R $(guix build hello)
>
> For a package output other than "out", I can do
>
> ls -R $(guix build coreutils | grep debug)
>
> But what about coreutils:out?
>
> Cheers,
> Konrad
Hi.
As the directory of the "out" output will have a shorter name, you could
sort the names by size and take the first one:
--8<---------------cut here---------------start------------->8---
for name in $(guix build coreutils); do printf "%d\t%s\n" "${#name}" "${name}";
done | sort -n | head -n 1 | cut -f 2
--8<---------------cut here---------------end--------------->8---
signature.asc
Description: PGP signature