I am using the following 2 commands to create a 0B file and set its extn to 644
touch filename.ext chmod 777 filename.txt
My question is that w
If you want to create the file not just empty but with content and mode at the same time you can use process substitution with install in bash:
install
install -m 755 <(echo commands go here) newscript
<() places the output into a temporary file (Process-Substitution)
<()