Reputation: 77
what condition is being checked below?
if [[ ! -s ${FILE} || -z ${FILE} ]]
(here $FILE is a data file)
Upvotes: 0
Views: 1041
Reputation: 8756
! -s ${FILE}
checks if file exists and is not empty
-z ${FILE}
checks if the FILE string length is zero
Upvotes: 1
Reputation: 5919
See the manpage for test(1)
. $FILE either does not exist, has zero size, or is an empty string.
Upvotes: 2