Reputation: 4486
My current shortcut has the following target: C:\Development\Git\git-bash.exe
How do i get it to execute something more complex such as:
C:\Development\Git\git-bash.exe **ls**
or
C:\Development\Git\git-bash.exe **java -jar myfile.war**
Upvotes: 7
Views: 10257
Reputation: 1325047
You can modify the shortcut with:
bash.exe --init-file <(echo "ls; pwd")
If you want git-bash, and in order to avoid git-bash to just open and close a Windows immediately after executing those commands, you would execute (or modify the shortcut):
C:\Development\Git\git-bash.exe -c "ls; $SHELL"
That way, the shell remains in place after executing the first commands you want.
In Windows 10/11 the shortcut target is particular about quotes.
This format seems to work:"C:\Program Files\Git\git-bash.exe" -c "emulator -avd Pixel3a -writable-system; $SHELL"
Upvotes: 9