This version is out of date, covering development as far as v4.2.5. It is maintained here only for inbound reference links from elsewhere. Jump to the current version of aTbRef. |
A Tinderbox Reference File : Actions & Rules : Invoke command line scripts |
Invoke command line scripts |
Actions may now invoke command-line scripts, from v3.6.0. The action
myString=`perl -v
runs the command
perl -v
and copies its standard output to the user string attribute myString.
The command is interpreted by /bin/sh .
The ` operator is not handled as a conventional unary operator, like negate (-). Tinderbox will do full variable interpolation, and the command may be assembled from other attributes and references:
myString=`$Command(parent)
So, the ` operator applies to everything up to the succeeding semicolon or the end of the command.
myString=`ls -l;Color=red;BorderColor=white;
The command may thus contain spaces. The command begins with the first non-white-space character following the `, and continues to the first semicolon. For example:
myString=`perl -v;Color=red;myDir=`pwd
Attribute interpolation is applied to the entire command line
Delivered=`myQuery $TrackingID $UserName(parent)
If you need to include the $ character in a command, escape it with backslash.
Interpolated attribute names are terminated when Tinderbox reaches the end of the command, a character that can't be part of an attribute name (e.g. white space), or a second $. Thus, if $AccountNumber holds the string "3716",
Delivered=`myDatebaseQuery $AccountNumber$x31
would create the command:
myDatabaseQuery 3716x31
Up: Actions & Rules | |
Previous: Self-Cancelling Rules & Actions | Next: Mathematical operators |
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]