roster takes option args of username

This commit is contained in:
James Tomasino 2018-11-27 14:11:56 -05:00
parent 5616be30d5
commit daa857e6b9
1 changed files with 4 additions and 3 deletions

View File

@ -17,9 +17,10 @@ do
printf "%s|%s\\n" "$owner" "$(basename "$shipdir")" >> "$temp_roster"
done
if [ "$1" = "count" ]; then
if [ "$#" -ne 1 ]; then
sort "$temp_roster" | column -s "|" -t
elif [ "$1" = "count" ]; then
sort "$temp_roster" | awk 'FS="|" {print $1}' | uniq -c
else
sort "$temp_roster" | column -s "|" -t
sort "$temp_roster" | column -s "|" -t | grep "$*"
fi