Skip to main content
100%

Gist 44be7198b7913c5e683122ab224baa9e

✓ Published0🌍 Public
HHerst
Last edited Jan 29, 2026
Created on Jan 29, 2026

This example demonstrates a shell-based spinner that provides visual feedback during a long-running command-line task. Instead of a graphical chart, it renders a rotating line animation directly in the terminal by updating a single carriage-returned character (`\r`) on the standard error stream. The script iterates through the characters of the string `/|-\` using a modulo index, printing one frame per line of piped input. It relies on standard shell constructs like `printf`, a `while` loop with `read`, and an environment variable for state, with no external JavaScript libraries or data sources involved. The spinner stops and clears the line after the input stream ends.

AI-generated description

Similar vizzes