Skip to content

Instantly share code, notes, and snippets.

@meelih
Created December 16, 2016 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meelih/aaad7c6b92e9036b0ac10fa5addd07ed to your computer and use it in GitHub Desktop.
Save meelih/aaad7c6b92e9036b0ac10fa5addd07ed to your computer and use it in GitHub Desktop.
#!/bin/bash
file_a=`cat $1`
file_b=`cat $2`
while IFS= read -r line_a
do
while IFS= read -r line_b
do
if [ "$line_a" != "$line_b" ];then
#echo "$line_a : $line_b"
echo "$line_b will be deleted"
echo "----"
docker rmi -f $line_b
elif [ "$line_a" == "$line_b" ];then
#echo "$line_a : $line_b"
echo "$line_a will be unchanged"
echo "----"
fi
done <<< "$file_b"
done <<< "$file_a"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment