Course of Raku / Objects, I/O, and exceptions / Input and output

Running external programs 🆕

Programs do not work in isolation — they often need to run other programs, read their output, and consult the environment they were started in. Raku gives you direct, convenient access to all of this.

This section covers run and shell for launching external commands, capturing what those commands print, and the %*ENV hash that holds the environment variables.

Topics in this section

Practice

Complete the quizzes that cover the contents of this section.

Exercises

This section contains 4 exercises. Examine all the topics of this section before doing the coding practice.

  1. Run a command
  2. Capture the output
  3. Check the exit code
  4. Pass a variable to a child

Course navigation

Quiz — Reading lines   |   run and shell