Created
June 3, 2022 23:02
-
-
Save MikuHatsune39/e09decbff2bc9b09243f3ff9ca73912a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # >NUL 2>NUL & "C:\Program Files\Git\bin\bash.exe" %0 & exit /b | |
| #!/bin/bash | |
| # vvv Just used to clear last line vvv | |
| clear_this_line(){ | |
| printf '\r' | |
| cols="$(tput cols)" | |
| for i in $(seq "$cols"); do | |
| printf ' ' | |
| done | |
| printf '\r' | |
| } | |
| erase_lines(){ | |
| test -z "$1" && lines="1" || lines="$1" | |
| UP='\033[1A' | |
| [ "$lines" = 0 ] && return | |
| if [ "$lines" = 1 ]; then | |
| clear_this_line | |
| else | |
| lines=$((lines-1)) | |
| clear_this_line | |
| for i in $(seq "$lines"); do | |
| printf "$UP" | |
| clear_this_line | |
| done | |
| fi | |
| } | |
| erase_lines 3 | |
| # ^^^ Remove if you want ^^^ | |
| # Your Bash Script Here | |
| printf $PATH # Example |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment