The Next Scripting Framework

[ Table Of Contents ]

nxsh(1) 2.4.0 doc "Command-line interface"

Name

nxsh - Simple shell containing NSF/NX interpreter

Table Of Contents

Synopsis

Description

nxsh ?-c ?arg1?? ?arg2 ...?

nxsh is a shell-like application that reads NX and Tcl commands from different sources and evaluates them.

If invoked without any arguments, nxsh runs in read-eval-print mode (REPL, interactive) similar to tclsh. In this mode, it reads commands from standard input interactively and prints command results as well as error messages to standard output. It remains active until the exit command is invoked or until it reaches end-of-file on its standard input.

If invoked with at least one positional argument arg1, nxsh runs a NX/Tcl script sourced from a file identified by arg1 using source.

Passing the -c flag makes nxsh accept commands from the command line provided by arg1. If arg1 is omitted, nxsh takes commands from standard input (e.g., in a pipe).

nxsh can be used like tclsh to make NX scripts directly invocable from the shell, by providing the following first line ("shebang") in the respective script:

	#! /usr/bin/env nxsh 

A (more portable) alternative is:

	#! /bin/sh
	# the next line restarts using nxsh \
	    exec nxsh "$0" "$@"