rey13

bash

Dec 10th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #variable1="pike horse trout blackbird cow hallibut crow turkey mackerel chaffinch"
  3. #variable2="salmon mackerel tuna hallibut trout pike sardine"
  4.  
  5. variable1=$1
  6. variable2=$2
  7.  
  8. for word in $variable1;do
  9.         if [ "${variable2//$word/}" != "$variable2" ];then
  10.                 variable1=${variable1//$word/}
  11.         fi
  12. done
  13.  
  14. echo "$variable1"
Add Comment
Please, Sign In to add comment