Goal: Checking find result, if empty echo something, if not echo find result
#!/bin/csh
set mtime = 0;
echo "<i>Title</i>" >> $outputfile
set text=`find start*middle*.txt -mtime $mtime -ls`
echo "$text" >> $outputfile
I have tried the following (all failed) ...
if (-f "$text" ) then
echo Exists
else
echo No such file
endif
-
if [[ -n $(find start*middle*.txt -mtime $mtime -ls) ]]
then
echo "res" >> $outputfile
fi
-
if [[ -n "$text" ]]
then
echo "res" >> $outputfile
fi