From 7deec13e8063724482c4d992c7c60e86c895d3e9 Mon Sep 17 00:00:00 2001 From: Henrique Moreira Date: Fri, 6 Nov 2020 15:01:01 +0000 Subject: [PATCH 1/2] Basic list from OL --- cotagente/horaconta/scripts/basic_office_list.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cotagente/horaconta/scripts/basic_office_list.sh b/cotagente/horaconta/scripts/basic_office_list.sh index ec96082..852849d 100755 --- a/cotagente/horaconta/scripts/basic_office_list.sh +++ b/cotagente/horaconta/scripts/basic_office_list.sh @@ -6,10 +6,21 @@ basic_list () { - sed 's/Henrique Moreira/@~/g' | tr \\012 ' ' | tr @ \\012 | grep "PT " + sed 's/Henrique Moreira/@~/g' | tr \\012 ' ' | tr @ \\012 | grep " PT " | \ + sed 's/ [P-Z][A-Z]* - Vacation Leave / vacation /' | \ + sed 's/ PT - Home Office / WFO /;s/ more_horiz //;s/ \([A-Z]\)[A-Za-z]* info[ ]*$/ \1/' | \ + sed 's/Unassigned=/UN/' | \ + grep -v " Cancelled" | stripped } +stripped () +{ + sed 's/\([0-9][0-9-]*\) to \([0-9][0-9-]*\)/\1...\2/' | \ + awk '{printf "%s, %s\n", $6, $0}' | \ + sed 's/\.00//g' +} + # # Main script From c9b6ddc56b2e4ab71d87c83b476dc7a1596d2ef3 Mon Sep 17 00:00:00 2001 From: Henrique Moreira Date: Fri, 6 Nov 2020 15:36:16 +0000 Subject: [PATCH 2/2] simplified output --- cotagente/horaconta/scripts/basic_office_list.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cotagente/horaconta/scripts/basic_office_list.sh b/cotagente/horaconta/scripts/basic_office_list.sh index 852849d..41c9dfd 100755 --- a/cotagente/horaconta/scripts/basic_office_list.sh +++ b/cotagente/horaconta/scripts/basic_office_list.sh @@ -1,12 +1,14 @@ #!/bin/sh +[ "$NAME" = "" ] && NAME="Henrique Moreira" [ "$F" = "" ] && F="tic.txt" basic_list () { - sed 's/Henrique Moreira/@~/g' | tr \\012 ' ' | tr @ \\012 | grep " PT " | \ + sed "s/$NAME/@~/g" | \ + tr \\012 ' ' | tr @ \\012 | grep " PT " | \ sed 's/ [P-Z][A-Z]* - Vacation Leave / vacation /' | \ sed 's/ PT - Home Office / WFO /;s/ more_horiz //;s/ \([A-Z]\)[A-Za-z]* info[ ]*$/ \1/' | \ sed 's/Unassigned=/UN/' | \