shellscriptwithterminal
SCRIPT

The shellscriptwithterminal statement runs a shell script in a new Terminal.app window (useful for debugging).


Parameters

This statement has one parameter:

script – shell script to run.


Description

This statement runs a shell script in a new Terminal.app window. This is similar to the shellscript statement, but instead of running the script invisibly, you can see the result in a Terminal.app window. For example, suppose you run the program:

shellscriptwithterminal {ls -l}

This will open a new window in Terminal.app and run the shell command ls -l, like this:

Panorama formulas can be embedded in the script using special tags. To embed a Panorama formula use

$«formula»$

The formulas are calculated in advance, then embedded into the source code as constants. For example, the formula $«2*3»$ will be embedded into the program as 6. The formula $«upper("hello world")»$ will be embedded as HELLO\ WORLD.

In the case of text formulas any special characters will be encoded as necessary for a proper shell script literal. For example the formula $«{"}»$ will be embedded as ".

To embed a Panorama formula with no quotes or translation use

^«formula»^

The shellscriptwithterminal statement only allows one line of shell script code, but you can run multiple shell script commands on a single line by separating each line with a semicolon. This example runs two commands - first it uses cd to switch to a different directory, then it runs a second command (in this case ls to list the directory contents).

let directory = "Desktop"
let command = "ls -l"
shellscriptwithterminal {cd $«directory»$;^«command»^}

See Also


History

VersionStatusNotes
10.2NewNew in this version.