---
layout: default
navsection: userguide
title: "Tutorial: Writing a Crunch script"
navorder: 102
---

{% include alert-stub.html %}

h1. Tutorial 2: Writing a Crunch script

In this tutorial, we will write the "hash" script demonstrated in the first tutorial.

*This tutorial assumes that you are logged into an Arvados VM instance, as described in "accessing arvados over ssh.":ssh-access.html#login*

h2. Setting up Git



h3. Inspect the code

The @script@ and @script_version@ attributes of a Job allow you to confirm the code that was used to run the job. Specifically, @script@ refers to a file in the @/crunch_scripts@ directory in the tree indicated by the commit hash @script_version@.

Example:

<pre>
cd
git clone git://github.com/clinicalfuture/arvados.git
cd arvados
git checkout $the_version
less crunch_scripts/hash
</pre>

<!--
_If we're going to direct the user to open up the code, some
discussion of the python API is probably in order.  If the hash
job is going to be the canonical first crunch map reduce program
for everybody, than we should break down the program line-by-line and
explain every step in detail._
-->


