I want to run my node app in background and curl simultaneously using &&. I tried the following but they don't work.
node app.js &;curl localhost
node app.js & && curl localhost
But neither work.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityI want to run my node app in background and curl simultaneously using &&. I tried the following but they don't work.
node app.js &;curl localhost
node app.js & && curl localhost
But neither work.
It's just :
node app.js & curl localhost
&
means put the preceding command in the background while &&
means run first command and if it succeeds run the second.
&&
? That's used when you want the second command to run if the first succeeded - and since you're not waiting for the first to end, that doesn't make sense