summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2018-10-07 23:12:32 -0400
committerJakob Kaivo <jkk@ung.org>2018-10-07 23:12:32 -0400
commit368d444b1bb2678ea086dfd88e112ae19d9a8a70 (patch)
treebb6407319f45780c7d26601046664f0483786cc9
parent29a453aec64d3833be2ceb109ac4a9c6c31d3ec2 (diff)
match executables in long format and directory names in recursive long formats
-rwxr-xr-xcolor-ls4
1 files changed, 2 insertions, 2 deletions
diff --git a/color-ls b/color-ls
index adf4167..ff7e7a7 100755
--- a/color-ls
+++ b/color-ls
@@ -124,8 +124,8 @@ _output () {
_colorize () {
awk -vcolor=0 -vlong=${long} '
{ color=39; }
- /\/$/ || (long && /^d/) { color=34; }
- /\*$/ { color=32; }
+ /\/$/ || (long && /^d/) || (long && $0 == $1) { color=34; }
+ /\*$/ || (long && /^-/ && $1 ~ /x/){ color=32; }
/\|$/ || (long && /^p/) { color=33; }
/@$/ || (long && /^l/) { color=35; }
long { printf("\033\[%sm%s\033\[0m\n", color, $0); }'