0
I had a Windows .bat file with a script for compilation of a project I'm working on. The last command is a maven build. Since it takes a while to finish, I wanted to be notified when it does.
I figured that the easiest way would be the equivalent to echo -e '\a'
. So I looked around a bit and added echo <BELL>
(<BELL>
being a byte with the code 0x07) at the end of my script. I added echo
in front of all commands for a quick test and it worked like a charm.
Removed the echos and ran the script. A few minutes later I notice it's finished. I didn't hear the bell, but assumed I just wasn't paying attention. Retested with echoes and it bell-ed just fine. However this has happened several times and I now know for a fact I'm not just missing it, it isn't there.
I've tried making a simple C program just running printf("\a")
to the same results. I've then just tried an echo please work
, this text didn't show up either. I've figured out that the difference is in the maven command being or not being echoed out. To sum up:
- Windows 10, Maven for Windows as last effective command in .bat batch script
- If mvn command is prepended with echo everythng works as it should
- If mvn command is ran subsequent commands in the .bat do not run
- Once the script finishes there appears to be nothing wrong with the cmd.exe instance
I have Cygwin (needed for the build) so if it's usefull for debugging that's not a problem.
EDIT: So it appears Maven is a batch file itself. Interrestingly, where mvn
lists first bhahlabh\mnv (a bash script) and then blahblah\mvn.com
3Is your
maven
command another batch file? – DavidPostill – 2019-08-17T19:52:28.907@DavidPostill No, just a regular
mvn clean package -define blah -define blahblah
kind – Mr Redstoner – 2019-08-17T19:54:23.470