In this cookbook, you will learn how to create a simple script command. You will see that
you can create it dynamically without restarting CRaSH.

NOTE: A better solution to create a command is to use CRaSH class.It provides tools to simply command creation.

== Run CRaSH

----
cd $CRASH_HOME/bin
./crash.sh
Type help at prompt
----

You will see something like :

----
 Try one of these commands with the -h or --help switch:

NAME      DESCRIPTION
clock
dashboard
date      show the current time
env       display the term env
filter
hello
help      provides basic help
java      various java language commands
jdbc      JDBC connection
jmx       Java Management Extensions
jndi      Java Naming and Directory Interface
jpa       Java persistance API
jvm       JVM informations
log       logging commands
man       format and display the on-line manual pages
shell     shell related command
sleep     sleep for some time
sort      Sort a map
system    vm system properties commands
thread    JVM thread commands
----

== Add new command

To add a command to CRaSH. You have to add a groovy file in the cmd directory :

----
cd $CRASH_HOME/cmd
vi test.groovy
----

Put the following in test.groovy :

[source,groovy]
----
for (int i = 0;i < 10;i++) {
  System.out.println("CRaSH is cool !");
}
----

NOTE: In this example, we create a command by using Java syntax. It's because Groovy understand Java Syntax. So you could begin to develop
your command in Java and when you want try cool Groovy stuff.

== refresh console

Type help again at prompt and you will see +test+ command.

----
  % help
Try one of these commands with the -h or --help switch:

NAME      DESCRIPTION
clock
dashboard
date      show the current time
env       display the term env
filter
hello
help      provides basic help
java      various java language commands
jdbc      JDBC connection
jmx       Java Management Extensions
jndi      Java Naming and Directory Interface
jpa       Java persistance API
jvm       JVM informations
log       logging commands
man       format and display the on-line manual pages
shell     shell related command
sleep     sleep for some time
sort      Sort a map
system    vm system properties commands
test
thread    JVM thread commands
----
