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?