05 Sep 2017 07:48:21 UTC
- Distribution: Term-Spinner-Color
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Issues (0)
- Testers (635 / 0 / 32)
- KwaliteeBus factor: 0
- 17.83% Coverage
- License: bsd
- Perl: v5.10.0
- Activity24 month
- Download (17.1KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:1 non-PAUSE userSWELLJOE Joe Cooperand 1 contributors
- Joe Cooper
spinner - A command to print a spinner and wait for a signal to stop.
One-liner from a POSIX-y shell:
# spinner & PID=$!; sleep 5; kill $PID
In a POSIX-y script:
spinner & PID=$! # Do some stuff sleep 5 kill $PID
In the above examples, "sleep 5" would be replaced with whatever long-running work you need to do. It can be one command or many.
This command can be used in shell scripts to print a spinner while you do stuff in the background. Once you've completed your work, you stop the spinner by sending a signal to the PID of the spinner process.
If you're working with Perl, you should use the Term::Spinner::Color module directly instead. If you prefer a pure-shell implementation, I've also built https://github.com/swelljoe/spinner which has nearly identical behavior, but only requires a POSIX-y shell.
Module Install Instructions
To install Term::Spinner::Color, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Term::Spinner::Color
For more information on module installation, please visit the detailed CPAN module installation guide.