Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » system facilities » input
next | previous | forward | backward | up | index | toc

# input -- read Macaulay2 commands and echo

- Usage:
    `input fn`
- Inputs:
  - fn, a string
- Consequences:
  - reads and executes the commands found in the file whose name is contained in the string fn, echoing the input, printing the values, and incrementing the line number

## Description

The file is sought in the directory containing the file currently being loaded, if any, and then along the path, unless the name of the file begins with /, ~/, $, or !. If the file begins with ./ or ../, then it looks instead in the directory of the file currently being loaded (see currentFileDirectory). If no file is being loaded it will look in the current directory (see currentDirectory).

If one of the top level expressions in the file evaluates to the symbol end the reading of the file is stopped at that point.

If an error occurs while evaluating the expressions in the file, reading is stopped.

## See also

- path -- list of directories to look in
- needs -- read Macaulay2 commands if necessary
- load -- read Macaulay2 commands

## For the programmer

The object input is a function closure.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_system.m2:190:0.