Help with Script: If diff between files is nothing then set a variable

how about a script that compares 2 files using diff (or similar) and if they are then same then set a variable, v1=int else v1=0.

thanks

Use diff exit code

diff file1 file2 > /dev/null
v1=$?
echo $v1

thanks this is very useful for what i want to do :slight_smile: