Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run bash -c without exit

Tags:

bash

mingw

msys

I'm trying to run MinGW's MSYS bash from Windows with a command in its arguments, and it's achievable with the -c switch. For example:

C:\MinGW\msys\1.0> bin\bash -c "times" 
0m0.000s 0m0.046s
0m0.000s 0m0.000s
C:\MinGW\msys\1.0>

With this command, bash will run, execute 'times', and exit.

Is it possible to do the same thing, but staying in a bash command line instead of exiting it?

like image 842
VCake Avatar asked Dec 15 '25 19:12

VCake


1 Answers

Try:

C:\MinGW\msys\1.0> bin\bash -c "times;/c/MinGW/msys/1.0/bin/bash"
like image 71
Chris Seymour Avatar answered Dec 17 '25 11:12

Chris Seymour



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!