Created
May 8, 2020 05:33
-
-
Save pinebright/aaa109f27b700a6de18f7194c80f392f to your computer and use it in GitHub Desktop.
bashでLS_COLORSをチェックするスクリプト
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 | |
IFS=: | |
for item in ${LS_COLORS}; do | |
color="$(echo ${item} | awk -F= '{print $2}')" | |
name="$(echo ${item} | awk -F= '{print $1}')" | |
case ${name} in | |
"no") name="global default";; | |
"fi") name="normal file";; | |
"di") name="directory";; | |
"ln") name="symbolic link";; | |
"pi") name="named pipe";; | |
"so") name="socket";; | |
"do") name="door";; | |
"bd") name="block device";; | |
"cd") name="character device";; | |
"or") name="orphan symlink";; | |
"mi") name="missing file";; | |
"su") name="set uid";; | |
"sg") name="set gid";; | |
"tw") name="sticky other writable";; | |
"ow") name="other writable";; | |
"st") name="sticky";; | |
"ex") name="executable";; | |
esac | |
printf '\e[%sm%s\e[m\n' ${color} ${name} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment