shellscript(
SOURCE
)

The shellscript( function executes a UNIX shell script and returns the result.


Parameters

This function has one parameter:

source – UNIX shell script (source code). Note: It is very convenient to use “pipe” delimiters for this parameter, for example |||script|||. This eliminates needing to worry about the delimiters that occur in the script itself.


Description

This function executes a UNIX shell script and returns the result. This example uses the ls command to list the files in the user library folder.

shellscript({cd ~/Library;ls -l})
    ☞ total 1976
       drwxr-xr-x     5 jimrea  staff      170 Apr  6  2005 Acrobat User Data
       drwx------     2 jimrea  staff       68 Dec 15  2003 Address Book Plug-Ins
       drwxr-xr-x   126 jimrea  staff     4284 Aug 19 13:44 Application Support
       drwx------     2 jimrea  staff       68 Oct 14  2003 Assistants
       drwx------     6 jimrea  staff      204 Feb  4  2006 Audio
       drwxr-xr-x    15 jimrea  staff      510 Aug  3 23:51 Automator
       drwxr-xr-x     2 jimrea  staff       68 May  1  2005 Autosave Information
       drwxr-xr-x     3 jimrea  staff      102 Feb 21  2007 Bundles
       drwx------   171 jimrea  staff     5814 Aug 30 09:44 Caches
       drwxr-xr-x     2 jimrea  staff       68 Jul 13 21:48 Calendars
       drwxr-xr-x     3 jimrea  staff      102 May  1  2005 Classic
       drwx------     7 jimrea  staff      238 May 26 17:00 ColorPickers
       drwxr-xr-x     3 jimrea  staff      102 Jan 23  2006 ColorSync
       ...

There are hundreds of different shell commands available. Describing all of these commands is beyond the scope of this documentation, but there are many books available, as well as numerous web resources.

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»^

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.