A
A
Alexander Osadchy2020-07-07 11:29:56
npm
Alexander Osadchy, 2020-07-07 11:29:56

How to combine commands in npm scripts?

For example, I have a command for authorization:

ssh [email protected]

and this command:

sudo /usr/bin/docker exec -ti -u www-data wordpressweb bash

How to combine them? To

ssh [email protected]

write to the console after the command

sudo /usr/bin/docker exec -ti -u www-data wordpressweb bash

In package.json I tried this - it didn't work:

...
  "scripts": {
    "SSH login": "ssh [email protected] && sudo /usr/bin/docker exec -ti -u www-data wordpressweb bash",
  },
...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2020-07-07
@RidgeA

do you need to ssh in and execute a command remotely?
`ssh [email protected] sudo ...`
man ssh

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question