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?
umask
to 000. – unxnut Aug 05 '22 at 15:34000
which allows all permissions bits to be on, but if the process doesn't request some of the bits on, they won't be on. – Sotto Voce Aug 05 '22 at 16:09