Search Results

Search: Posts Made By: rogers42
2,557
Posted By durden_tyler
if [ -s test.txt ]; then echo "File exists and...
if [ -s test.txt ]; then echo "File exists and has size > 0"; fi


tyler_durden
2,557
Posted By Corona688
If you're just trying to tell if the file is...
If you're just trying to tell if the file is empty, you can do this:

[ -s "test.txt" ] && mailx -s "test file" email.yahoo.com < test.txt

-s means "file exists, and is not empty".
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 02:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy