Toolbox Differences Between macOS / Linux / Windows

Toolbox Differences Between macOS / Linux / Windows#

Across the Squirro documentation are examples of commands that you can run using the command line interface. While most of them work on a Squirro server using bash or zsh, you might sometimes want to use Squirro Toolbox for Windows. This document highlights some of the differences between the Linux/macOS commands and the Windows variants so that if you encounter a reference for one, you can easily get it to work for 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.