Commit 5e7712cd authored by Vitaly Lipatov's avatar Vitaly Lipatov

estrlist: add uniq alias

parent 6574eec2
...@@ -56,6 +56,10 @@ union() ...@@ -56,6 +56,10 @@ union()
list $@ | sort -u list $@ | sort -u
} }
uniq()
{
union $@
}
# remove_from_list "1." "11 12 21 22" -> "21 22" # remove_from_list "1." "11 12 21 22" -> "21 22"
reg_remove() reg_remove()
...@@ -116,6 +120,7 @@ help() ...@@ -116,6 +120,7 @@ help()
echo "exclude <list1> [list2] - print list2 words contains also in list1" echo "exclude <list1> [list2] - print list2 words contains also in list1"
echo "reg_exclude <PATTERN> [word list] - print only words not matched with PATTERN" echo "reg_exclude <PATTERN> [word list] - print only words not matched with PATTERN"
echo "union [word list] - sort and remove duplicates" echo "union [word list] - sort and remove duplicates"
echo "uniq [word list] - alias for union"
echo "list [word list] - just list word by line" echo "list [word list] - just list word by line"
echo "count [word list] - print word count" echo "count [word list] - print word count"
echo echo
...@@ -143,9 +148,11 @@ if [ "$COMMAND" = "-h" ] || [ "$COMMAND" = "--help" ] ; then ...@@ -143,9 +148,11 @@ if [ "$COMMAND" = "-h" ] || [ "$COMMAND" = "--help" ] ; then
fi fi
shift shift
# FIXME: do to call function directly, use case instead?
if [ "$1" = "-" ] ; then if [ "$1" = "-" ] ; then
shift shift
"$COMMAND" "$(cat)" "$COMMAND" "$(cat) $@"
else else
"$COMMAND" "$@" "$COMMAND" "$@"
fi fi
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