Jenny M Jenny M - 3 months ago 8
Linux Question

Chmod for application via script

Im creating a script file and I want to add the permission via chmod -R 777 myApp/*

I add to the script the following line

cd /home/abc/aa_tmp chmod -R 777 myApp/*


which doesnt work , when I try to update/edit file I got permission denied, any idea what I miss here?

Answer

you can use this;

#!/bin/bash
chmod -R 777 /home/abc/aa_tmp/myApp/*

if the user has enough privileges above script works. But if permissions is as below, throw permission denied

user@host:/tmp/$ ls -arlt
..
d---------  2 user user  4096 Aug 25 16:38 myApp
..
Comments