Quick note: since this list is used for more than just my dotfiles,
please set format.subjectPrefix to 'PATCH dotfiles'. Thanks!
On Mon Sep 13, 2021 at 6:14 AM UTC, Evan Johnston wrote:
> ---> bin/g | 5 ++++-> 1 file changed, 4 insertions(+), 1 deletion(-)>> diff --git a/bin/g b/bin/g> index 12879b9..387962e 100755> --- a/bin/g> +++ b/bin/g> @@ -30,7 +30,10 @@ case "$CMD" in> "pf") CMD="push -f" ;;> "r") CMD="rm" ;;> "rc") CMD="rm --cached" ;;> - "rtfm") exec man "$(find /usr/share/man -name "git-*" | sed -e 's:.*/::' -e 's/\..*//' | shuf -n1)" ;;> + "rtfm") exec man "$(find /usr/share/man -name "git-*" |> + sed -e 's:.*/::' -e 's/\..*//' |> + awk 'BEGIN{srand()}{print rand() * 1000000 "\t" $0}' |
Once we're bringing awk in, let's drop the sed in favor of sub(). We
also don't need the second sed expr - not sure why I had it in the first
place.
In addition, please add a space between the BEGIN block and the second
block.
> + sort -n | head -n1 | cut -f2-)" ;;> "s") CMD="status" ;;> "se") export GIT_EDITOR="$EDITOR" CMD="send-email" ;;> "sl") CMD="shortlog" ;;> --> 2.33.0