メインコンテンツまでスキップ
バージョン:25.2

read from file

  • command to read text or values from a file after using the open file command to open it
  • read from input, read from stdin -- read from the standard input stream (useful in a script run from the command line). The following forms are available:
    • read from input until end -- reads entire file, piped input, or until control-D is typed
    • read from input until <char> -- reads up to and including the specified character
    • read from input for <count> -- reads at most the indicated number of bytes
    • Example:

    You can now create interactive scripts, by doing something along these lines:

        write "prompt: " to output

        read from input until return

        if it is "stop!" then exit run -- or whatever you want to do with it