iankelling.org
/
git
/
small-misc-bash
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0976d81
)
minor improvement: if ls has nonzero exit, return it
master
author
Ian Kelling
<iank@fsf.org>
Wed, 9 Oct 2024 05:45:19 +0000
(
01:45
-0400)
committer
Ian Kelling
<iank@fsf.org>
Wed, 9 Oct 2024 05:45:19 +0000
(
01:45
-0400)
ll-function
patch
|
blob
|
history
diff --git
a/ll-function
b/ll-function
index f683464d0e260277d354805a9493113b671556c5..5b2c36b6c2921578c42ba0f18cfd79d8e95f2ec5 100644
(file)
--- a/
ll-function
+++ b/
ll-function
@@
-41,7
+41,7
@@
EOF
;;
esac
local x y perm line binls sizePadding middle tail size \
;;
esac
local x y perm line binls sizePadding middle tail size \
- max_hl_digits hardlinks initial_space hardlink_spacing
+ max_hl_digits hardlinks initial_space hardlink_spacing
out
local max_hl_digits=0
local -a lines hl
binls=$(type -P ls)
local max_hl_digits=0
local -a lines hl
binls=$(type -P ls)
@@
-50,6
+50,8
@@
EOF
$binls -lA "$@"
return
fi
$binls -lA "$@"
return
fi
+ out=$("$binls" -lAh --color=always "--time-style=+%m-%d %Y
+%m-%d %I:%M %P" "$@")
local aclchar=false
# there's no way to tell if ls uses the acl specifier unless we loop over the data twice
# the 11th char is either
local aclchar=false
# there's no way to tell if ls uses the acl specifier unless we loop over the data twice
# the 11th char is either
@@
-87,8
+89,7
@@
EOF
fi
hl+=("$hardlinks")
fi
fi
hl+=("$hardlinks")
fi
- done< <( "$binls" -lAh --color=always "--time-style=+%m-%d %Y
-%m-%d %I:%M %P" "$@" )
+ done<<<"$out"
hardlink_spacing=$((max_hl_digits + 1))
hardlink_spacing=$((max_hl_digits + 1))