Last active
December 11, 2015 06:08
-
-
Save rummelonp/4556533 to your computer and use it in GitHub Desktop.
突然の死
This file contains 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 | |
function suddenize() { | |
typeset text hit length i header footer | |
text=$1 | |
hit=0 | |
for i in $( seq 1 ${#text} ); do | |
hit=$(( $hit + $(expr $text[$i] : '[ -~]') )) | |
done | |
length=$(( ${#text} - $(( $hit / 2 )) + 2 )) | |
for i in $( seq 1 ${length} ); do | |
header='人'$header | |
footer='Y'$footer | |
done | |
echo _${header}_ | |
echo > ${text} < | |
echo  ̄${footer} ̄ | |
} | |
suddenize $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment