[root@localhost scripts]# more run_mongodb_cmd.sh #!/bin/bash /usr/local/services/mongodb/bin/mongo localhost:28001 << EOF use admin db.auth("root","123456"); db.serverStatus(); EOF