From 50a191d600dd5880d1775efe47889c73ce0f1939 Mon Sep 17 00:00:00 2001 From: lohhiiccc Date: Tue, 26 May 2026 19:20:48 +0200 Subject: [PATCH] feat: broken colleen in bash --- src/Colleen.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/Colleen.sh diff --git a/src/Colleen.sh b/src/Colleen.sh new file mode 100644 index 0000000..9784794 --- /dev/null +++ b/src/Colleen.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -o posix + +src=$'#!/usr/bin/env bash\n\nset -o posix\n\nsrc=$\'@\'\nfor (( i=0; i<${#src}; i++ )); do\n\tc=\"${src:i:1}\"\n\tascii=$(printf \'%d\' \"\'$c\")\n\n\tif [[ $ascii -eq 64 ]]; then\n\t\tfor (( j=0; j<${#src}; j++ )); do\n\t\t\tascii_j=$(printf \'%d\' \"\'${src:j:1}\")\n\t\t\tcase $ascii_j in\n\t\t\t\t92) echo -en \'\\\\\' ;;\n\t\t\t\t34) echo -en \'\\\\\"\' ;;\n\t\t\t\t39) echo -en \"\\\\\'\" ;;\n\t\t\t\t9) echo -en \'\\\\t\' ;;\n\t\t\t\t10) echo -en \'\\\\n\' ;;\n\t\t\t\t*) echo -en \"${src:j:1}\" ;;\n\t\t\tesac\n\t\tdone\n\telse\n\t\techo -en \"$c\"\n\tfi\ndone\n\n' +for (( i=0; i<${#src}; i++ )); do + c="${src:i:1}" + ascii=$(printf '%d' "'$c") + + if [[ $ascii -eq 64 ]]; then + for (( j=0; j<${#src}; j++ )); do + ascii_j=$(printf '%d' "'${src:j:1}") + case $ascii_j in + 34) echo -en '\\"' ;; + 39) echo -en "\\'" ;; + 9) echo -en '\\t' ;; + 10) echo -en '\\n' ;; + *) echo -en "${src:j:1}" ;; + esac + done + else + echo -en "$c" + fi +done +