Course of Raku / Essentials / Positional data types / Exercises / Print command-line arguments

Solution: Print command-line arguments

The program gets the arguments from the command line in the array @*ARGS. So, we have to loop over its elements.

Code

.say for @*ARGS;

🦋 Find the program in the file number-of-command-line-arguments.raku.

Output

Run the program and confirm it prints the arguments line by line:

$ raku exercises/positionals/print-command-line-arguments.raku hello command-line arguments
hello
command-line
arguments

Course navigation

Typed variables / Allomorphs   |   Associative data types