From 617b71e648ab9bfa0572d4ca503b8b42f7290686 Mon Sep 17 00:00:00 2001 From: Nicole O'Connor Date: Sun, 19 Apr 2020 23:16:20 -0700 Subject: [PATCH] use cmp for comparisons --- zshrc-stub | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/zshrc-stub b/zshrc-stub index 51d18e7..b9411e9 100644 --- a/zshrc-stub +++ b/zshrc-stub @@ -8,13 +8,11 @@ RPROMPT="%{$fg_bold[black]%}%T%{$reset_color%}" _zshrc_updates_pending=0 if type md5sum &> /dev/null; then - current_stub_sum="$(md5sum ~/.zshrc | awk '{ print $1 }')" - new_stub_sum="$(md5sum ~/.local/share/zeesh/zshrc-stub | awk '{ print $1 }')" - - if [[ ! current_stub_sum == new_stub_sum ]]; then + cmp -s ~/.zshrc ~/.local/share/zeesh + if [[ $? -eq 1 ]]; then cp ~/.local/share/zeesh/zshrc-stub ~/.zshrc _zshrc_updates_pending=1 fi fi -[[ _zshrc_updates_pending -eq 1 ]] && printf "zeesh: updates pending\n" +[[ _zshrc_updates_pending -eq 1 ]] && printf "zeesh: stub updates pending\n"