字符串变量取交集、并集、差集
2022-01-04 本文已影响0人
车到山前必有路2021
function jiaoji(){
data=echo "$1" "$2" | tr ' ' '\n' | sort | uniq -d | tr '\n' ' '
echo $data
}
function bingji(){
data=echo "$1" "$2" | tr ' ' '\n' | sort | tr '\n' ' '
echo $data
}
function chaji(){
2
data=echo "$1" "$2" "$2" | tr ' ' '\n' | sort | uniq -u | tr '\n' ' '
echo $data
}