TOTΣM
TOTΣM

Reputation: 59

How to specify execution on a specific port in bash?

I have a script to run a service:

#!/bin/bash
export HOME=/home/recusr

cd /home/recusr/pasayobloques/blokes/
su myUser -c meteor -- port 9999   
exit

But I get the following error message when running it:

su unrecognized option '--port'

Upvotes: 0

Views: 1162

Answers (1)

Barmar
Barmar

Reputation: 781255

The entire command argument to su must be a single argument.

su myUser -c 'meteor --port 9999'

In your script, --port is being interpreted as the next argument to su, not part of the command after -c.

Upvotes: 3

Related Questions