i need help. I have file vm.list:
VM-NAME1|WEEKDAY|2| VM-NAME2|WEEKDAY|4| VM-NAME3|WEEKDAY|3| VM-NAME4|WEEKDAY|4| VM-NAME5|WEEKDAY|4| VM-NAME6|WEEKDAY|1| VM-NAME7|WEEKDAY|1| VM-NAME8|WEEKDAY|4| VM-NAME9|WEEKDAY|2| VM-NAME10|WEEKDAY|4| VM-NAME11|WEEKDAY|4| I need list divide into new lists depending of 3 value and action run:
LIST1: VM-NAME6 VM-NAME7 LIST2: VM-NAME1 VM-NAME9 LIST3: VM-NAME3 LIST4: VM-NAME2 VM-NAME4 VM-NAME5 VM-NAME8 VM-NAME10 VM-NAME11 Just about it
for i in $(awk -F "|" '{print $3}' today.list | sort | uniq) do echo $i awk -F "|" '{ if ($3 == '$i') print $1 }' today.list done i understand what it incorrect, but i don't have ideas