Advertisement
kaslmineer7999

GNU BASH Rotater spinner functikn

Apr 2nd, 2025
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.44 KB | None | 0 0
  1. #!/usr/bin/bash
  2.  
  3. #BASH rotater paste by:
  4. #kaslmineer7999
  5.  
  6. rotater(){
  7.     local frames=('|' '/' '-' '\')
  8.     local frame="0"
  9.     local command="$1"
  10.     while [ 1 ]
  11.     do
  12.         printf "%s\r" "${frames[$frame]}"
  13.         local frame="$(($frame+1))"
  14.         [ "$frame" = "4" ] && local frame="0"
  15.         sleep 0.1
  16.     done &
  17.     local pid=$!
  18.     eval $command
  19.     kill -9 $pid
  20. }
  21. #SYNTAX: rotater "YOUR_COMMAND"
  22. #Note to replace "YOUR_COMMAND" with your actual command, keep in quotes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement