Toolbox Differences Between macOS / Linux / Windows#

Across the Squirro documentation, you will encounter examples of commands to execute on the command line.

While most will run on a Squirro Server and therefore be on CentOS/RHEL (using bash or zsh), there are moments when you will work with the Squirro Toolbox on Windows.

This document highlights some of the differences between the Linux / macOS-based commands and the Windows variant (cmd.exe or PowerShell) so that if you encounter a reference or example for one, you can easily get it to work on the other

Commands Are Logically the Same#

No matter what OS you are on, the Squirro Toolbox is the same: Python 3 based source code and application, hence all the commands and command arguments are the same.

The following snippet will work on all supported operating systems:

squirro_asset widget upload --token 7e1...... --cluster https://myinstance.squirro.com -f mywidget

Multiline Command#

Since one liners can be hard to read, they are sometimes split into multiple lines.

Different command line interpreters have different characters.

Linux / Mac (bash or zsh)

squirro_asset widget upload \
--token 7e1...... \
--cluster https://myinstance.squirro.com \
-f mywidget

Windows (cmd.exe)

squirro_asset widget upload ^
--token 7e1...... ^
--cluster https://myinstance.squirro.com ^
-f mywidget

Tip: The difference here is the backlash character / vs the caret character ^.

Variables#

In the above example, token and cluster values are used directly in the command.

It is best practice not to do that, as it has security implications and is not re-usable. It is better to use environment variables.

Linux / Mac (bash or zsh)

squirro_asset widget upload \
--token $TOKEN \
--cluster $CLUSTER \
-f mywidget

Windows (cmd.exe)

squirro_asset widget upload ^
--token %TOKEN% ^
--cluster %CLUSTER% ^
-f mywidget

Tip: The difference here is that bash/zsh uses the $ character versus cmd.exe, which uses two % characters.

Summary#

There are more complex differences between the different interpreters that are out of the scope of this document.

In general, when you encounter a command example in bash/zsh with the Squirro Toolbox you can easily convert the example to work on Windows, as shown above, and vice versa.