Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I have the code below for running a code that uses mongodb in a .sh file. I am running my code in windows but I think these commands are for Linux. I would be very thankful if someone can let me know the equivalent commands in windows.
#!/bin/bash
base_dir="$1"
echo "Starting MongoDB..."
mongodb/bin/mongod --dbpath "$base_dir"/mongodb/data/db > /dev/null &
sleep 10
echo "Starting Jetty server..."
java -Xmx8g -jar easy_esa.jar 8800 index &
sleep 10
–
–
–
For Windows to run program in background is a bit diffeent. The best way is to set it up as service. Here is short manual how to create service from program.
Step One: Install SrvStart
Step Two: Create a Configuration File for the New Service
Step Three: Use the Command Prompt to Create the New Service
/dev/null
in Windows is NUL:
so your command will become:
command parameters > NUL:
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.