From 0231552c4e66dd802008927104c32275d7daaa99 Mon Sep 17 00:00:00 2001 From: Dan Nguyen Date: Mon, 21 Sep 2015 10:18:15 -0500 Subject: [PATCH] use bash substring rather than cut --- gitstatus.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitstatus.sh b/gitstatus.sh index dbc0bc9..234926d 100755 --- a/gitstatus.sh +++ b/gitstatus.sh @@ -65,11 +65,11 @@ elif [[ "$branch" == *"no branch"* ]]; then else IFS="[]" read -ra remote_line <<< "${line[3]}" if [[ "${remote_line[1]}" == *ahead* ]]; then - num_ahead=`echo "${remote_line[1]}" | cut -c 7-` + num_ahead=${remote_line[1]:6} remote="${remote}_AHEAD_${num_ahead}" fi if [[ "${remote_line[1]}" == *behind* ]]; then - num_behind=`echo "${remote_line[1]}" | cut -c 9-` + num_behind=${remote_line[1]:9} remote="${remote}_BEHIND_${num_behind}" fi fi