Run a command only if the previous command was successful in Fish (like && in bash)
17
votes
1
answer
3687
views
Using Bash I've often done things like
cd /study && ls -la
I understand that the double ampersand is telling the terminal don't execute part two of this command unless part one completes without errors.
My question is, Having just moved to the Fish shell and trying the same command I get an error stating I can't use &&
and instructing me to use a single &
which I believe backgrounds the task which isn't what I want.
Can anyone tell me the correct syntax to run my old Bash command in the Fish shell?
Asked by Nathaniel
(440 rep)
Feb 10, 2016, 04:16 AM
Last activity: Apr 22, 2025, 08:03 PM
Last activity: Apr 22, 2025, 08:03 PM