commit b09d7d116c203b9264b9e3d42f4d3b073df5dc4d parent 15167fe66b282b2be586af4a6a27617e1470a7cb Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Thu, 9 Apr 2020 07:44:26 +0200 Use find for randomfile, and reuse randomfile for randomman Diffstat:
M | .profile | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.profile b/.profile @@ -150,11 +150,11 @@ t_stop_done() { } randomfile() { - printf '%s/%s\n' "${1:-.}" "$(ls -p "${1:-.}" | grep -v / | sort -R | head -1)" + printf '%s\n' "$(find "${@:-.}" -type f -maxdepth 1 | sort -R | head -1)" } randomman() { - man -l "$(ls /usr/share/man/man[23567]/*.[23567] | sort -R | head -1)" + plumb "$(randomfile /usr/share/man/man[23567]/*.[23567])" } alias julia-fast='julia --procs 1 --optimize=3 --math-mode=fast'