Rune

From Erights

Jump to: navigation, search

Rune is the interactive command line interpreter for E code.

Contents

Setting up rune

Windows: Copy the file rune-bat-template.txt to rune.bat and edit the settings in the file.

Hint: If you plan on using rune a lot, you should try Console, a Windows console window enhancement

unix/linux/mac/cygwin: Copy rune-template.txt to rune and edit it. Add execute rights to the file by entering chmod a+x rune.

You should now be able to execute rune and get an interactive shell.

As an alternative, rune can be started using the java executable:

$ java -jar e.jar --rune

Running an E script from rune

There are several ways to start an E script using rune.

Calling the "rune" script explicitly

Given that the "rune" script is on your PATH, you can give the name of the .e script as a command line argument to rune:

$ rune [options...] example.e [args...]

The additional args after example.e are available from within example.e as the value of the expression

interp.getArgs()

For more information on the options, do

$ rune --help

Calling the "rune" shell script implicitly

On the unix/linux/mac/cygwin platforms, you can place #!/usr/bin/env rune on the first line of example.e, make example.e executable, and use it directly as a command:

$ example.e [args...]

On cygwin, text files beginning with a "#!" are automatically considered executable.

Calling the "rune" function from within a running E system

You can start the script directly from the E command prompt, which can save some time because the running Java VM is used:

? rune(["example.e"])

Launching from the desktop

Currently on Windows only, you can double click on the shortcut icon for example.e in the file explorer (desktop).

Command history

The interactive E interpreter does not provide command history. Under windows, the shell has its own command history, which can be used by pressing the up and down arrow keys. If your system does not provide command history, you can try rlwrap.

Personal tools
more tools