Sha256: cf1de77b0f7d5640abf8a4c29b94587003f8c4dd94c1a332bd1ad87f8485b682

Contents?: true

Size: 738 Bytes

Versions: 2

Compression:

Stored size: 738 Bytes

Contents

#+title: Running scripts in parallel

In the following example, the following 3 scripts should be run in parallel
with all output being flushed to the screen.

- Count some numbers with bash

  #+begin_src sh :shebang #!/bin/bash
  echo '' > out.log
  for i in `seq 1 5`; do 
  echo "Writing! $i"
  echo "hello $i" >> out.log
  sleep $(($RANDOM % 10))
  done
  #+end_src

- Count some numbers with ruby

  #+begin_src ruby :shebang #!/usr/bin/ruby
  sleep 0.2
  10.times do |n|
    puts "And now writing! #{n}"
    File.open("out.log", "a") {|f| f.puts "Hello again #{n}" }
    sleep rand.round(2)
  end
  #+end_src

- Print some numbers with python

#+begin_src python :shebang #!/usr/bin/python
for i in range(0,3):
  print i
#+end_src

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
org-converge-0.0.4 spec/converge_examples/basic_run_example/setup.org
org-converge-0.0.3 spec/converge_examples/basic_run_example/setup.org