It is true that i may not have understood how umask calculations work.
This query is just for a test case (my learning).
My intention is that my process should generate a file pdf file1.pdf with full permission 777 however, it generates a maximum of 666 permissions only.
#!/bin/bash
export umask=111;
echo "Tomcat is starting .... "
rm file1.pdf
umask 111
echo "Hello" >file1.pdf
echo "Tomcat started"
Output post run:
root@6b5c5e56c544:/tmp/exersize# ls -ltr file1.pdf
-rw-rw-rw- 1 root root 6 Aug 5 15:22 file1.pdf
Can you please explain as a layman why cant I set file permissions to 777 and how I can?