E-Sharp Helpcenter
Breadcrumbs

Exit command

Exit Application

Description

The exit command terminates the AccordionShell application. This cleanly closes any active connections and exits the program.

Syntax

Bash
exit

Options

This command has no options.

Examples

Exit the Application

Bash
exit

Output:

See ya later!

The application then terminates.

In Script Context

Bash
# Connect and perform operations
init --host 192.168.1.100
get --channel "SENSOR_1"
set --channel "OUTPUT" --value "1"

# Clean exit
exit

Output Format

See ya later!

Output Colors

  • Dark Yellow: Exit message

Behavior

  1. Displays farewell message

  2. Calls Environment.Exit(0)

  3. Immediately terminates application

  4. Exit code: 0 (success)

Use Cases

Interactive Mode Exit

Bash
AccordionShell.exe
> init --host accordion-dev
> list
> get --channel "STATUS"
> exit

Application closes and returns to shell prompt.

Script Completion

Bash
# script.bat
AccordionShell.exe init --host 192.168.1.100
AccordionShell.exe set --channel "POWER" --value "ON"
AccordionShell.exe wait --channel "READY" --value "1"
AccordionShell.exe exit

Ensures clean termination after scripted operations.

Error Recovery Exit

Bash
# If errors occur, exit cleanly
init --host 192.168.1.100
# ... error occurs ...
exit  # Clean shutdown

Connection Handling

Active Connections

exit terminates immediately:

  • Does NOT send disconnect to hardware

  • Does NOT wait for pending operations

  • Connection is abruptly closed

Best Practice: For clean disconnection, use specific disconnect options first:

Bash
# Clean disconnect for firmware operations
firmware --disconnect
exit

# For standard operations, exit is sufficient
exit

Alternatives to Exit

Alternative

Use Case

Ctrl+C

Interrupt running operation, then exit

firmware --disconnect

Disconnect SSH session before exit

Close window

Force termination (not recommended)

Exit Codes

Code

Meaning

0

Normal exit via exit command

Other

Abnormal termination or error

Notes

  • Immediate: Exit is immediate, no confirmation prompt

  • No Cleanup: Does not perform hardware cleanup operations

  • State Lost: Any unsaved state is lost

  • Connection: Hardware connection is dropped (hardware continues running)

Best Practices

  1. Save Work First: Ensure critical operations are complete

  2. Document State: Note hardware state before exiting

  3. Clean Disconnect: Use firmware disconnect for SSH sessions

  4. Script Usage: Always include exit at end of scripts

Interactive Mode

In interactive mode, you can also exit by:

  • Typing exit

  • Pressing Ctrl+C (keyboard interrupt)

  • Closing the terminal window

The exit command is the cleanest method.

Script Mode

In script mode, exit is typically not needed as AccordionShell exits after executing the command:

Bash
# This exits automatically after execution
AccordionShell.exe get --channel "SENSOR"

# Exit is redundant but harmless
AccordionShell.exe get --channel "SENSOR"
AccordionShell.exe exit

Comparison with Other Commands

Command

Purpose

Connection

exit

Terminate application

Dropped

firmware --disconnect

Close SSH session

SSH closed, app continues

reset

Reset hardware

Maintained

Error Scenarios

Cannot Exit (Theoretical)

The exit command calls Environment.Exit(0) which forcefully terminates the process. It cannot fail under normal circumstances.

If the application appears frozen:

  1. Press Ctrl+C

  2. Close terminal window

  3. Use Task Manager (Windows) or kill command (Linux)

Example Sessions

Quick Check Session

Bash
$ AccordionShell.exe
> init --host 192.168.1.50
Connected to 192.168.1.50
> get --channel "TEMPERATURE"
23.5 °C
> exit
See ya later!
$

Configuration Session

Bash
$ AccordionShell.exe
> init --host accordion-lab-01
> alias --activate "lab_config.xml"
> list --filter "POWER.*"
POWER_MAIN: ON
POWER_AUX: OFF
> set --channel "POWER_AUX" --value "ON"
> exit
See ya later!
$