Quantcast
Viewing latest article 2
Browse Latest Browse All 2

How to hide command output, then run another command

I have this command which may output an error, so I hide it using &>/dev/null.

Now I would like to run this command, then run another command.

This is what I have now:

( aaa &>/dev/null ) && bbb

I'm expecting to see:

Command 'bb' not found...

But I do not see any output. Maybe it is because the first command does not exist? If it does exist, the second command will run.

I also tried using || instead of &&. This does not work when the first command actually does succeed.

How do I achieve this for both a succesful first command run and an unsuccesful case in a single line?


Viewing latest article 2
Browse Latest Browse All 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>