2

I am writing a shell script where path can be ~/as-NY/com or ~/as-LN/com whatever is available. I can achieve this in K-shell as

cd ~/as-(NY|LN)/com, but not sure about bash. Can someone help here

1 Answer 1

2

In BASH you need to enable extglob and do it like this:

shopt -s extglob
cd ~/as-@(NY|LN)/com
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.