Multiple commands per line (Bash): verschil tussen versies

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen
(Nieuwe pagina aangemaakt met '== Commando's achter elkaar uitvoeren == Als je commando's scheidt met <code>;</code>, worden ze achter elkaar uitgevoerd. Bv.: <pre> mkdir blub; cd blub </pre>...')
 
 
Regel 20: Regel 20:
  
 
<code>||</code>
 
<code>||</code>
 +
 +
== Commando's gelijktijdig uitvoeren ==
 +
 +
Nu wordt 't leuk: Commando's gelijktijdig uitvoeren! Dat doe je met <code>&<code>.
  
 
== Bronnen ==
 
== Bronnen ==
  
 
* https://www.howtogeek.com/269509/how-to-run-two-or-more-terminal-commands-at-once-in-linux/
 
* https://www.howtogeek.com/269509/how-to-run-two-or-more-terminal-commands-at-once-in-linux/
 +
* https://unix.stackexchange.com/questions/162645/is-it-possible-to-run-two-commands-at-the-same-time-in-a-shell-script

Huidige versie van 25 sep 2021 om 21:39

Commando's achter elkaar uitvoeren

Als je commando's scheidt met ;, worden ze achter elkaar uitgevoerd. Bv.:

mkdir blub; cd blub

of zonder spatie:

mkdir blub;cd blub

Condtioneel - als vorige commando is gelukt

&&

Condtioneel - OR

||

Commando's gelijktijdig uitvoeren

Nu wordt 't leuk: Commando's gelijktijdig uitvoeren! Dat doe je met &.

Bronnen