Executable Scripts
Risor scripts can easily be made directly executable on MacOS and Linux.
In the steps below, the Risor script filename is myscript
. The full path
to the script is /path/to/myscript
.
1. Add a shebang line at the start of the Risor script:
#!/usr/bin/env risor
2. Allow execution as a program by using chmod
:
chmod +x /path/to/myscript
3. Optionally, update your PATH
variable so that your shell can find the script:
export PATH=/path/to/:$PATH
Now you should be able to run myscript
as a program from your shell.
You should add the export PATH
statement to ~/.bashrc
or ~/.zshrc
to persist the
modified PATH
variable for future sessions.
Example Script
myscript
#!/usr/bin/env risor
print("just a test")