Course of Raku / Essentials / Running programs

Running from command line

Save the text of the program in a text file, for example, hello.raku and pass the path to the file to the command-line tool raku (the dollar character indicates shell’s prompt):

$ raku hello.raku

If the program does not contain errors, it will be immediately executed, and if it generates any output, you will see the result in the terminal:

$ raku hello.raku 
Hello, World!

When working with Unix-based systems, you can add a shebang and make the file executable:

#!/usr/bin/env raku

say 'Hello, World!';

The next steps are the following:

$ chmod a+x hello.raku
$ ./hello.raku
Hello, World!

Course navigation

Running programs   |   Running programs / Running from REPL

💪 Or jump directly to the exercise to this section.