source for core

Runs a script file in the current context.

Signature

> source {flags} (filename)

Parameters

  • filename: the filepath to the script file to source

Input/output types:

input output
any any

Examples

Runs foo.rsh in the current context

> source foo.rsh

Runs foo.rsh in current context and call the command defined, suppose foo.rsh has content: def say-hi [] { echo 'Hi!' }

> source ./foo.rsh; say-hi

Notes

This command is a parser keyword. For details, check: https://irsh.vercel.app/book/thinking_in_rsh.html