Last active
June 4, 2017 01:03
-
-
Save greymd/885097d96cbb82e8e2cfdbd90ab0bfea to your computer and use it in GitHub Desktop.
山田エルフ.sh
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
yes 山田エルフ \ | |
| head -n 5 \ | |
| awk -vFS= -vOFS=" " 'NR==1{system("echo "$0"|rev|tr -d \\\\n");print $2$3$4$5};NR<6{s=$(NR+1);for(i=0;i<4-NR;i++)printf OFS;printf s;for(i=1;i<NR;i++)printf OFS;printf s;for(i=1;i<NR;i++)printf OFS;print s;}' | |
# -- Result | |
# フルエ田山田エルフ | |
# 田田田 | |
# エ エ エ | |
# ル ル ル | |
# フ フ フ | |
# もっと短く。 | |
export P='for(i=1;i<NR;i++)printf OFS;printf s;'; yes 山田エルフ \ | |
|head -n 5 \ | |
| awk -vFS= -vOFS= " 'NR==1{system("echo "$0"|rev|tr -d \\\\n");print $2$3$4$5}{s=$(NR+1);'"${P/NR/5-NR}$P${P/printf s/print s}"'}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment