1

Say I want to send the output of to commands into another.

cat a.txt && ls

I can do this:

fish -c "cat a.txt && ls" | another_command

But it seems clunky, is there a way to do this without running a new instance?

  • You can redirect the output with arrow symbol (greater than and less than symbols). – Biswapriyo Feb 13 at 6:34
  • @Biswapriyo, right - but how to do this for two commands to pipe into another_command? – ideasman42 Feb 13 at 8:02
2

use a begin...end block

begin; cat a.txt; ls; end | another_command

or with whitespace

begin
    cat a.txt
    ls
end | another_command

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.