if [[ -s log.txt ]];
What does -s mean? I know -z means zero sized string. I cannot find any documentation on -s.
What does [] or [[]] mean, while writing an if
condition. I have used if
without [] or [[]] and it worked fine.
bashshell-script
if [[ -s log.txt ]];
What does -s mean? I know -z means zero sized string. I cannot find any documentation on -s.
What does [] or [[]] mean, while writing an if
condition. I have used if
without [] or [[]] and it worked fine.
Best Answer
The
-s
test returns true ifThis is documented in the
bash
manual, and also in the manual for thetest
utility (the test may also be writtenif test -s file; then
).For
[ ... ]
and[[ ... ]]
, see: Bash - If Syntax confusion