1

Check if file exists if not send an alert

view story
linux-howto

http://www.unix.com – Hi, Im looking to write a script to check if a file exists and if it doesnt then send an email out, Ive found the below code but I don't understand the ! in the if statement can anyone explain? Any help will be much appreciated Code: #!/bin/bash if [ ! -s filename ] then         echo "File not exists" | mailx -s "File Not found" [email protected] else         echo "File exists"         fi (HowTos)