Ask Your Question
0

one line script doesn't work

asked 2016-07-21 07:54:22 -0500

So it's pretty basic, I have a one line script called runner.sh (surprise) that goes something like this

MONGO_URL=somurl/meteor meteor --settings settings.json --port 3000

the thing is, if I run it like ./runner.sh I get the following error --port must include a port. which is crazy, because the port is there. Even crazier is, that if I just copy the line into the terminal, it works.

For the record, I tried adding a space, new line, prepending it with #/usr/bin/bash and stuff, but nothing helps. Any help, please?

edit retag flag offensive close merge delete

Comments

The line you need at the top is actually #!/usr/bin/bash (note the !), unless you just typed it wrong in the question.

ssieb gravatar imagessieb ( 2016-07-26 14:06:22 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-07-21 13:56:23 -0500

florian gravatar image

updated 2016-07-21 13:59:01 -0500

Try this:

#!/bin/bash
MONGO_URL="someurl/meteor"
meteor --settings settings.json --port 3000

or even export the variable

export MONGO_URL="..."

You may even have to do a

meteor --port someurl:3000
edit flag offensive delete link more
0

answered 2016-07-21 17:30:55 -0500

sergiomb gravatar image

You may try :

bash runner.sh
edit flag offensive delete link more

Question Tools

Stats

Asked: 2016-07-21 07:54:22 -0500

Seen: 55 times

Last updated: Jul 21 '16