Commit 03dde3cd authored by vagrant's avatar vagrant

[BSA-00] (ArndtED) Adds Mr. Alim's solution to 5

parent 2e2a1181
......@@ -2,4 +2,22 @@
PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P })
echo $PARENT_PATH
[[ -z $1 ]] && echo "No input arguments provided" && exit 1
declare -A projects
total=0
while read LINE
do
IFS=, read start end name email projectId country billFlag hours<<< "$LINE"
if [[ $billFlag == "Y" ]]; then
projects[$projectId]=$(( ${projects[$projectId]} + $hours ))
total=$(( $total + $hours ))
fi
done < $1
printf "%-20s %6s\n" "Project" "Hours"
for projectId in "${!projects[@]}"
do
printf "%-20s %6s\n" "$projectId" "${projects["$projectId"]}"
done
printf "%-20s %6s\n" "Total" "$total"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment