I have a script that automate the rebuilding of mongo db's for our servers:
#!/bin/sh
mongo local:host 127.0.0.1 mongodb-create-ourdatabase.js > validate.txt
mongoimport --host 127.0.0.1 --db ourdatabase --collection ourUser --file create-ourUser.js > validate.txt
The output of the first line when the database is created writes to file, but the output of the second line, where the collection ourUser is created outputs to screen.
What am I missing?