&&
is notoriously hard to search for on Google Search, but the best I've found is this article which says to use -and
.
Unfortunately it doesn't give any more information, and I can't find out what I'm supposed to do with -and
(again, a notoriously hard thing to search for).
The context I'm trying to use it in is "execute cmd1, and if successful, execute cmd2", basically this:
csc /t:exe /out:a.exe SomeFile.cs && a.exe
If you just want to run multiple commands on a single line and you don't care if the first one fails or not, you can use ;
For most of my purposes this is fine.
For example: kill -n myapp; ./myapp.exe
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…