Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1231765 > unrolled thread

Bug#1095160: Disable messages when the apt command is used with pipe

Started byPierre Tomon <pierretom+23@ik.me>
First post2025-02-04 17:10 +0100
Last post2025-02-05 14:30 +0100
Articles 5 — 2 participants

Back to article view | Back to linux.debian.bugs.dist


Contents

  Bug#1095160: Disable messages when the apt command is used with pipe Pierre Tomon <pierretom+23@ik.me> - 2025-02-04 17:10 +0100
    Bug#1095160: Disable messages when the apt command is used with pipe Pierre Tomon <pierretom+23@ik.me> - 2025-02-04 18:10 +0100
      Bug#1095160: Disable messages when the apt command is used with pipe Johannes Schauer Marin Rodrigues <josch@debian.org> - 2025-02-04 20:20 +0100
    Bug#1095160: Disable messages when the apt command is used with pipe Pierre Tomon <pierretom+23@ik.me> - 2025-02-05 13:30 +0100
      Bug#1095160: Disable messages when the apt command is used with pipe Johannes Schauer Marin Rodrigues <josch@debian.org> - 2025-02-05 14:30 +0100

#1231765 — Bug#1095160: Disable messages when the apt command is used with pipe

FromPierre Tomon <pierretom+23@ik.me>
Date2025-02-04 17:10 +0100
SubjectBug#1095160: Disable messages when the apt command is used with pipe
Message-ID<KctER-emWA-5@gated-at.bofh.it>
Source: apt
Version: 2.9.27
severity: wishlist

Messages like:

```
WARNING: apt does not have a stable CLI interface. Use with caution in
scripts.

Listing...
```

[toc] | [next] | [standalone]


#1231773

FromPierre Tomon <pierretom+23@ik.me>
Date2025-02-04 18:10 +0100
Message-ID<KcuAV-enyk-7@gated-at.bofh.it>
In reply to#1231765
Yes I need to pipe it, I want to do things like:
apt list '~o' | cut -d '/' -f1 | tr '\n' ' '

I won't those useless messages.

[toc] | [prev] | [next] | [standalone]


#1231786

FromJohannes Schauer Marin Rodrigues <josch@debian.org>
Date2025-02-04 20:20 +0100
Message-ID<KcwCJ-eoS1-5@gated-at.bofh.it>
In reply to#1231773

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Tue, 4 Feb 2025 16:57:38 -0000 Pierre Tomon <pierretom+23@ik.me> wrote:
> Yes I need to pipe it, I want to do things like: apt list '~o' | cut -d '/'
> -f1 | tr '\n' ' '
> 
> I won't those useless messages.

the message is useful. It tells you that you are doing it wrong. Why don't you
use a tool with an output format that is designed to be consumed by scripts?

    apt-cache show "~o" | sed -ne 's/^Package: //p' | xargs

cheers, josch

[toc] | [prev] | [next] | [standalone]


#1231863

FromPierre Tomon <pierretom+23@ik.me>
Date2025-02-05 13:30 +0100
Message-ID<KcMHv-eAI2-3@gated-at.bofh.it>
In reply to#1231765
Hi,

On Tue, 04 Feb 2025 20:09:40 +0100 Johannes Schauer Marin Rodrigues
<josch@debian.org> wrote:

> the message is useful. It tells you that you are doing it wrong.

There is nothing wrong here, the shell allows it, I use it.

> Why don't you use a tool with an output format that is designed to be
> consumed by scripts?
> 
>     apt-cache show "~o" | sed -ne 's/^Package: //p' | xargs

Yes, I use that now instead of the `apt` command, it seemed faster
and more practical with the latter.

[toc] | [prev] | [next] | [standalone]


#1231867

FromJohannes Schauer Marin Rodrigues <josch@debian.org>
Date2025-02-05 14:30 +0100
Message-ID<KcNDz-eBjC-1@gated-at.bofh.it>
In reply to#1231863

[Multipart message — attachments visible in raw view] — view raw

Quoting Pierre Tomon (2025-02-05 13:23:21)
> On Tue, 04 Feb 2025 20:09:40 +0100 Johannes Schauer Marin Rodrigues
> <josch@debian.org> wrote:
> 
> > the message is useful. It tells you that you are doing it wrong.
> 
> There is nothing wrong here, the shell allows it, I use it.

the moment you pipe stdout into another process, standard output of the process
on the left side of the pipe is no longer connected to an interactive terminal.
This is a difference. The "apt" tool does not have a stable CLI interface. You
used it in a script because you connected apt's standard output to another
process using a pipe. That is not an interactive tty. Yes, you are doing it
wrong. Please read up on the difference.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web