I am working on writing a Bash function to start a server that needs to be run from a specific folder, but I do not want this server to affect my current work. I wrote the following:
function startsrv {
pushd .
cd ${TRUNK}
${SERVERCOMMAND} &
popd
}
My variables are all set, but when this is done, I get an error message with an unexpected semicolon in the output, it seems that Bash is inserting a semicolon after the ampersand, starting ${SERVERCOMMAND}in the background.
Is there anything I can do to run ${SERVERCOMMAND}in the background, still using pushd and popd, to make sure I get back to my current directory?
Edit: output echo ${SERVERCOMMAND}since it was requested:
yeti --server --port 8727
Error message:
-bash: syntax error near unexpected token `;'
source
share