11.04.2013 Views

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DEAD=1<br />

avar= # Global; holds current generation.<br />

generation=0 # Initialize generation count.<br />

Appen<strong>di</strong>ce A. Script aggiuntivi<br />

# =================================================================<br />

let "cells = $ROWS * $COLS"<br />

# How many cells.<br />

declare -a initial # Arrays containing "cells".<br />

declare -a current<br />

<strong>di</strong>splay ()<br />

{<br />

alive=0 # How many cells "alive" at any given time.<br />

# Initially zero.<br />

declare -a arr<br />

arr=( ‘echo "$1"‘ ) # Convert passed arg to array.<br />

element_count=${#arr[*]}<br />

local i<br />

local rowcheck<br />

for ((i=0; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!