4

I have a bash script foo.sh and I want to execute it with some arguments --bar from PowerShell Core. This doesn't work:

./foo.sh

1 Answer 1

4

Use a & operator

& "./foo.sh"

Or execute it using bash

& bash "./foo.sh"
Sign up to request clarification or add additional context in comments.

2 Comments

It turns out you can also just do ./foo.sh.
Using & "./foo.sh" or ./foo.sh just opens foo.sh in the text editor on my system. To actually run the script I had to use: & bash "./foo.sh"

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.