A
A
antimodern2019-01-24 15:35:41
bash
antimodern, 2019-01-24 15:35:41

Why is there an error/warning in the ENDSSH: command not found script?

There is a script like this

ssh $user@$host << ENDSSH
cd /var/node/$app
git pull origin master
npm install
npm run build
pm2 restart $app // 21 line
ENDSSH // 22 line

Everything works, but at the end of the execution I noticed such lines in the console
./deploy.sh: line 21: pp: command not found
./deploy.sh: line 22: ENDSSH: command not found

Why these 2 warnings and how to fix?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Q
q2zoff, 2019-01-24
@q27off

Apparently, the problem is in the content of the app variable. Enclose in quotes:

ssh [email protected]$host << ENDSSH
cd /var/node/"$app"
git pull origin master
npm install
npm run build
pm2 restart "$app"
ENDSSH

B
Boris Syomov, 2019-01-24
@kotomyava

The space after << is superfluous.
Well, just in case, // not a comment in bash, # should be.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question