22
如何通过Shell脚本执行mongo命令?
我想mongo在外壳脚本中执行命令,例如在脚本中执行命令test.sh: #!/bin/sh mongo myDbName db.mycollection.findOne() show collections 当我通过执行脚本时./test.sh,将建立与MongoDB的连接,但不会执行以下命令。 如何通过Shell脚本执行其他命令test.sh?
专业和发烧友程序员的问答