Created
September 15, 2025 11:52
-
-
Save Stewie410/212b0f294e1b7035a0447e813a4cdf48 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
| #!/usr/bin/env bash | |
| main() { | |
| local -A count | |
| local -a result | |
| local i | |
| while read -r i; do | |
| case "${i:0:1}" in | |
| A | C | D | I | M | R | X ) (( count["${i:0:1}"]++ ));; | |
| "?" ) (( count["q"]++ ));; | |
| "!" ) (( count["b"]++ ));; | |
| "~" ) (( count["t"]++ ));; | |
| esac | |
| done < <(svn --non-interactive status --depth="immediates") | |
| for i in "A" "C" "D" "I" "M" "R" "X" "q" "b" "t"; do | |
| (( count["${i}"] > 0 )) || continue | |
| case "${i}" in | |
| q ) result+=( "?:${count["$i"]}" );; | |
| b ) result+=( "!:${count["$i"]}" );; | |
| t ) result+=( "~:${count["$i"]}" );; | |
| * ) result+=( "${i}:${count["$i"]}" );; | |
| esac | |
| done | |
| printf '%s' "${result[*]}" | |
| } | |
| main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment