beetlebug▾
/

info script

Gives the name of the file of the script that runs, or sets it.

info script ?NAME?

Description

Gives the path of the file that source or the runner runs, as that command got it. With NAME, sets that name for the rest of the run of the file, and gives NAME.

Arguments

ArgumentTypeDefaultDescription
NAMEfile pathnoneThe new name of the script.

Returns

A file path, or an empty string.

Examples

% info script foo.tcl
foo.tcl

% info script foo.tcl; info script
foo.tcl

Errors

% info script a b
wrong # args: should be "info script ?filename?"
-errorcode TCL WRONGARGS

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.1

See also