Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #variable1="pike horse trout blackbird cow hallibut crow turkey mackerel chaffinch"
- #variable2="salmon mackerel tuna hallibut trout pike sardine"
- variable1=$1
- variable2=$2
- for word in $variable1;do
- if [ "${variable2//$word/}" != "$variable2" ];then
- variable1=${variable1//$word/}
- fi
- done
- echo "$variable1"
Add Comment
Please, Sign In to add comment