]> git.donarmstrong.com Git - bin.git/commitdiff
use awk instead of cut
authorDon Armstrong <don@donarmstrong.com>
Tue, 29 Jan 2019 02:00:42 +0000 (18:00 -0800)
committerDon Armstrong <don@donarmstrong.com>
Tue, 29 Jan 2019 02:00:42 +0000 (18:00 -0800)
upload_ics

index a093fbdb4d932d1e9c151818d30f7bd178bcd874..ce96a8f4b3ba381405bb5197017fa93d60c4158f 100755 (executable)
@@ -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"