how to KSH: Import File With Variables and Functions

In KSH, you can import a file with variables and functions by using the “.” (dot) command. The syntax is as follows:

. /path/to/file

This will execute the file and make any variables and functions defined in the file available in the current shell.

Alternatively, you can use the “source” command, which has the same effect:

source /path/to/file

Please note that the imported file must be in KSH, otherwise it will not be executed and will raise an error.

Leave a Comment