منبع اصلی نوشتار زیر در این لینک قرار دارد

ماتریکس در ترمینال

چند روز پیش یکی از دوستان در گودر از CommandLineFu.com یک دستور (اسکریپت؟!) به اشتراک گذاشته شده رو به اشتراک گذاشته بود (!) و من هم می‌خوام اون رو در این‌جا به اشتراک بگذارم، کار این اسکریپت در اصل چیز خاصی نیست، فقط پنجره شل (Shell) شما رو توسط اعداد ۰ و ۱شبیه ماتریکس میکنه (;

echo -e “e[32m”; while :; do for i in {1..16}; do r=”$(($RANDOM % 2))”; if [[ $(($RANDOM % 5)) == 1 ]]; then if [[ $(($RANDOM % 4)) == 1 ]]; then v+=”e[1m $r   “; else v+=”e[2m $r   “; fi; else v+=”     “; fi; done; echo -e “$v”; v=””; done

matrix_style

I like the fact the Patola’s version uses only ones and zeros, but I also like the sparse output of the other versions. This one combines both of those features and eliminates some unnecessary cruft.

You can vary the sparseness by changing “$(($RANDOM % 5))” to another number. The number in this term “$(($RANDOM % 4))” controls how frequently the numbers are output bold.

Matrix Style



برچسب ها : , , , ,