Score:0

Difference between single ampersand and double ampersand?

cn flag

I know some people have asked about the difference between a semicolon and double ampersand to chain commands.

But what I see in this file from SQL Server Docker, is SINGLE ampersand.

What does it mean?

What's the difference between these two lines of codes:

/opt/mssql/bin/sqlservr & /usr/src/app/import-data.sh & npm start 
/opt/mssql/bin/sqlservr && /usr/src/app/import-data.sh && npm start 
sudodus avatar
jp flag
& puts the previous command into the background (releases the terminal) and the next command can be executed parallel to the previous one; && is logical AND, which makes the following command be executed only if the previous command was finished successfully, with error code 0.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.