2

I am trying to run the following bash script and it gives me the following error

#!/bin/bash -x

jars= $HOME/SelGridProto/selserversidedjars

java -jar $jars/selenium-server-standalone-2.44.0.jar -role hub -hubConfig $jar/ServerHub.json

Upon bash execution, it says,

start_sel_grid_serv.sh: line 3 : /HomeDirectory/SelGridProto/selserversidedjars: Is a directory
Error: Unable to access jarfile /selenium-server-standalone-2.44.0.jar

I am trying to pass on the path to the directory and execute the jar.

Also, ServerHub.json resides in the same directory. When I execute the cmd to start the server within selserversidedjars directory it works fine whereas gives me errors on using it through bash script.

There must be a better way to execute the jar with parameters through bash which I am not educated about right now. Please help.

Thanks in advance!

1 Answers1

2

You need to delete the space after the =.  By saying

jars= $HOME/SelGridProto/selserversidedjars

you are telling the shell to run $HOME/SelGridProto/selserversidedjars with jars set to an empty string.  Just make it

jars=$HOME/SelGridProto/selserversidedjars