2

I'm trying to write an alias to open several new Bash terminals and run a given command in each one. From this question: How to launch a Git Bash window with particular working directory using a script? I've got an alias that opens multiple windows in the right folder, but I can't figure out how to get each window to run any commands without typing them in manually after.

This is what I've got so far:

alias openterminals='(cd C:/folder/one && start sh --login); (cd C:/folder/two && start sh --login); (C:/folder/three && start sh --login);'
NVRM
  • 11,480
  • 1
  • 88
  • 87
  • @Tabitha_Hastie `sh` is taking `--login` as an arg. it should be possible to pass something like `-c ls` as well to make a terminal open and list files. I cant make it work, though. You could try a .bashrc which does pwd and runs the commands you want depending on where it is run from. – ColonelFazackerley Mar 10 '18 at 13:06

0 Answers0