Invoke command line scripts via back-tick (DEPRECATED)

Tinderbox Icon

This pages describes features, codes or syntax whose use is now DEPRECATED, i.e. not advised either for new or continued pre-existing use.

Deprecated aspects of Tinderbox may be supported on a legacy basis but the latter support can't be presumed to be indefinite. Therefore you should update your active TBX documents to latest practice as soon as practical.


DEPRECATED - use the runCommand function - see runCommand().

Actions may invoke command-line scripts. An alternate, and better way to access command lines is to use the runCommand() operator. The latter also benefits from not requiring a left side to the expression and allows more scope for control of whitespace and use of quotes.

When accessing the command line this way the current working directory this is '/', i.e. the root of the current volume.

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 

From v5.8.0, the older method of evaluating $References within quoted strings has been discontinued.


Possible relevant notes (via "Similar Notes" feature):

Up: Import/Export/Formatting
Previous: Inserting images into notes  Next: Last-used OS folder 

A Tinderbox Reference File : Import/Export/Formatting : Invoke command line scripts via back-tick (DEPRECATED)

Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map

[Last updated: 16 May 2012, using v5.11.1]


Search:

Google search aTbRef for:  


Creative Commons Licence

aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

[See aTbRef CC licence Attribution & Waiver info]

Made with Tinderbox