Beginner in ksh - umask query

I started to learn KSH

I am doing some exercises from the book

$ umask =rx, u+w                                       
$ print Keep track of everythine > file1.out           
$ print Be careful >> file1.out                        
ksh: file1.out: cannot create [Permission denied]
$ umask -S                                             
u=,g=,o=
$ set -o | tee tee.out | grep ignoreeof                
ignoreeof                off
$ grep monitor < tee.out                               
ksh: tee.out: cannot open [Permission denied]
$ print ~me | grep me | cat >> file1.out         
ksh: file1.out: cannot create [Permission denied]
$ print *.out                                          
file1.out tee.out
$ /usr/bin/grep track *.out | wc                       
grep: can't open file1.out
grep: can't open tee.out
       0       0       0
$ grep track < f*out | wc                              
ksh: file1.out: cannot open [Permission denied]
       0       0       0
$ time sleep 20 > /dev/null 2>&1                       

real    0m20.02s
user    0m0.00s
sys    0m0.00s

I see I can do much with files I created because of umask is set to 022. But interesting is I can create new files (example with tee command). Why I can do this if my umask is 022 ?

Your second umask command unset all permissions! The command was interprested as umask = and the rest of the line was ignored. Thus the file was created with permissions 000 . From that point on only the root user could write to that file.

umask -S
u=rwx,g=rx,o=rx

umask =  
umask -S
u=,g=,o=

Try looking at the directory with ls -la and learn to understand the first column (permissions).

When adjusting umask , the parameters are like u=rw (and many other variations). See man umask and thence man chmod for the full explanation.