DEV Community

Discussion on: Run multiple commands in one line with `;`, `&&` and `||` - Linux Tips

Collapse
 
nem8 profile image
nem8

Sure, but you need to re-write it slightly..
echo 'Test' > A
cat A && echo 'A passed' || echo 'A failed' && (cat B && echo 'B passed' || echo 'B failed')
Test
A passed
cat: B: No such file or directory
B failed