Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Execute a Bash Script from PowerShell Core in Linux

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
like image 341
Muhammad Rehan Saeed Avatar asked Oct 16 '25 03:10

Muhammad Rehan Saeed


1 Answers

Use a & operator

& "./foo.sh"

Or execute it using bash

& bash "./foo.sh"
like image 79
programmer365 Avatar answered Oct 18 '25 20:10

programmer365