bBox_Zsh( mode; text {; ...} )

Parameters:

   mode:

      0 = convert both input and output line endings, wait for output

      1 = skip conversion of carriage returns (the FileMaker end-of-line marker) to new lines

      2 = skip translation of new lines in shell output to carriage returns

      3 = don't translate input or output line endings

      4 = don't wait for completion

   text: input text to be processed

   param1: Zsh option or parameter (optional)

   … {zero or more parameters}


Result:

   stdout from Zsh execution (truncated to a maximum of 160 MB)


Error:

   bBox_LastError ("posix")


Script Step:

   bBox Zsh [ Script; $1; $2; $3; $4 ]

––––––––––

First appeared in: 0.95

Examples in demo file: 8

Compatibility:   Client, macOS, Server, Ubuntu, WebDirect, WPE

––––––––––

Executes the given text using the zsh shell.

You can use zsh’s -s option to use parameters from FileMaker in your zsh script. The following FileMaker calculation can help illustrate:

bBox_Zsh (0; "echo $1 :: $2"; "-s"; "value 1"; Quote ("value2"))

The output will then be:

value 1 :: "value2"

For macOS, Zsh is the default user shell. Zsh is largely compatible with Bash, and  many scripts will run correctly with either.

On Ubuntu, Zsh is not installed by default. You can install Zsh with the command:

sudo apt-get install zsh

Watch out for character encoding issues! By default, Bash will be using “c” for its character encoding, which only handles ASCII characters. This will cause problems with any high-bit or multibyte UTF-8 characters.

Scripts and their commands will be limited to 600 seconds of sustained CPU usage and 2 GB of memory. Use to get the exit status (error number) from your script.

––––––––––

bBox Functions

bBox Wiki