From: Don Armstrong Date: Tue, 29 Jan 2019 02:00:42 +0000 (-0800) Subject: use awk instead of cut X-Git-Url: https://git.donarmstrong.com/?p=bin.git;a=commitdiff_plain;h=e0f2a19e2b1e4b47e0c0ab78bcf036d818ff2eec use awk instead of cut --- diff --git a/upload_ics b/upload_ics index a093fbd..ce96a8f 100755 --- a/upload_ics +++ b/upload_ics @@ -9,8 +9,8 @@ tempdir=$(readlink -f "$tempdir") trap "/bin/rm -f \"$tempdir\"/*.ics; rmdir \"$tempdir\"" QUIT INT EXIT for file in "$@"; do - bevents=($(grep -hn BEGIN:VEVENT "$file" | cut -d: -f0)) - eevents=($(grep -hn END:VEVENT "$file" | cut -d: -f0)) + bevents=($(grep -hn BEGIN:VEVENT "$file" | awk -F: '{print $1}')) + eevents=($(grep -hn END:VEVENT "$file" | awk -F: '{print $1}')) ehead=${bevents[0]} let "ehead -= 1"