Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide multiple command output in fish shell?

Let's say there is a set of commands as follows:

#!/usr/bin/env fish

command1
command2
command3

Each command prints its own output, which I want to hide. In bash it's rather simple:

#!/usr/bin/env bash
{
command1
command2
command3
} &> /dev/null

But it does not work in fish. Is there any solution other than sending each and every command to /dev/null? Can somebody help me with that?

like image 811
Zoltar Avatar asked Oct 18 '25 13:10

Zoltar


1 Answers

Fish's equivalent to {} command grouping is begin and end, so

begin
    command1
    command2
    command3
end &> /dev/null
like image 156
faho Avatar answered Oct 22 '25 06:10

faho



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!