If the second argument is a directory, append the filename from the

first argument.

This matches the behavior of diff.
This commit is contained in:
Ewan Mellor
2019-03-07 15:04:26 -08:00
parent 421668e490
commit ec81932335

View File

@ -71,6 +71,12 @@ then
exit 1
fi
if [[ -d "$f2" ]]
then
f=$(basename "$f1")
f2="$f2/$f"
fi
if [[ "$f2" != '/dev/null' ]] && [[ ! -f "$f2" ]]
then
echo "$f2: No such file." >&2