#!/bin/bash -e if [ -s diff.txt ]; then # The file is not-empty. rm -f empty.txt touch full.txt else # The file is empty. rm -f full.txt touch empty.txt fi