From 023af993ac129a7ced5a62214f0b4de216c7008f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Mon, 23 Nov 2020 13:56:00 +0100 Subject: [PATCH] Numberation from 1 to n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .local/bin/emerge-logs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/emerge-logs b/.local/bin/emerge-logs index bf9ab1f..142f611 100755 --- a/.local/bin/emerge-logs +++ b/.local/bin/emerge-logs @@ -2,12 +2,12 @@ LOGS=( $(sudo find /var/tmp/portage/ -mindepth 1 -maxdepth 5 -name "build.log") ) LEN=${#LOGS[@]} -for (( i=0; i<$LEN; i++ )); +for (( i=1; i<$LEN; i++ )); do - echo "$i - ${LOGS[$i]}" + echo "$i - ${LOGS[$i-1]}" done echo read -p 'Select number to show logs: ' NUMBER -sudo tail -f ${LOGS[$NUMBER]} +sudo tail -f ${LOGS[$NUMBER-1]}