To answer your first question: '>' is not a math / comparison operator 'more than'; this is a bash way to let you output to a file (handle).
echo "some text" > myfile.txt
will create a file called myfile.txt, and '>' will send the output of the command to this file. I would suggest that your file "0" has a pid, and nothing more.
Instead, try -gt (or related options: -ge , -lt , -le , -eg , -ne ) to check if one value is greater (or: greater than or equal, less, less or equal, equal, not equal , respectively) to see if this helps. I.e
until [ $notepad -gt 0 ]
source share