if-not-equal
if-not-equal - compare two values for inequality
SYNOPSIS
Section titled “SYNOPSIS”state-name: tool: if-not-equal arguments: left: <value1> right: <value2> goto: true: <not-equal-state> false: <equal-state>DESCRIPTION
Section titled “DESCRIPTION”The if-not-equal tool is the negated version of if-equal. It returns "true" if the values differ, or "false" if they are equal.
Both values are trimmed of whitespace before comparison. The comparison is case-sensitive.
ARGUMENTS
Section titled “ARGUMENTS”| Argument | Required | Default | Description |
|---|---|---|---|
left | Yes | - | First value to compare |
right | Yes | - | Second value to compare |
EXIT CODES
Section titled “EXIT CODES”| Code | Meaning |
|---|---|
0 | Success (outputs “true” or “false”) |
1 | Missing required argument |
OUTPUT
Section titled “OUTPUT”The tool outputs "true" if the values differ, or "false" if they are equal.
EXAMPLES
Section titled “EXAMPLES”Detect Changes
Section titled “Detect Changes”check-changed: tool: if-not-equal arguments: left: "{{ old_value }}" right: "{{ new_value }}" goto: true: handle-change false: no-changeSkip If Already Done
Section titled “Skip If Already Done”check-status: tool: if-not-equal arguments: left: "{{ status }}" right: "completed" goto: true: do-work false: already-doneValidate Environment
Section titled “Validate Environment”ensure-not-production: tool: if-not-equal arguments: left: "{{ environment }}" right: "production" goto: true: allow-operation false: block-productionCheck for Errors
Section titled “Check for Errors”verify-no-error: tool: if-not-equal arguments: left: "{{ error_code }}" right: "0" goto: true: handle-error false: continue-successCOMMON PATTERNS
Section titled “COMMON PATTERNS”Guard Against Specific Value
Section titled “Guard Against Specific Value”not-default: tool: if-not-equal arguments: left: "{{ config_value }}" right: "default" goto: true: use-custom-config false: use-default-configChange Detection Loop
Section titled “Change Detection Loop”watch-changes: tool: bash arguments: command: cat state.txt output: var(current_state) next: detect-change
detect-change: tool: if-not-equal arguments: left: "{{ current_state }}" right: "{{ previous_state }}" goto: true: state-changed false: no-change