#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2008
    Posts
    209
    Rep Power
    9

    Bash on cygwin: No such file or directory


    Code:
    commonMongo=s:/programs/mongodb/
    dbpath=$commonMongo"data/"
    logFile=$commonMongo"log.txt"
    mongoProg=s:/programs/mongodb/mongodb/
    mongoBin=$mongoProg"bin/"
    mongod=$mongoBin"mongod.exe"
    a=$1
    if [ "$a" == "start" ];then
    	"${mongod} --logpath ${logFile} --logappend --dbpath ${dbpath} &"
    elif [ "$a" == "repair" ];then
    	"${mongod} --dbpath ${dbpath} --repair"
    else
    	echo "Incorrect usage"
    fi
    ./init.sh: line 11: s:/programs/mongodb/mongodb/bin/mongod.exe --dbpath s:/programs/mongodb/data/ --repair: No such file or directory

    Calling the printed command works fine:

    s:/programs/mongodb/mongodb/bin/mongod.exe --dbpath s:/programs/mongodb/data/ --repair
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2008
    Posts
    209
    Rep Power
    9
    Fixed by not wrapping the command in double quotes.

IMN logo majestic logo threadwatch logo seochat tools logo