17

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?

1 Answer 1

23

Starting with version 3 of fish, && and || are supported, as discussed in the tutorial. (release notes for 3.0.0, GitHub issue #4620)


On earlier versions, they aren't, so you must use ; and the command and:

cd /study; and ls -la

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.