I have a site, with some template directories, there are a few modules, each with their own template dir (So there are N dirs called templates
).
Each of those dirs has a dir in it, called translated
. I need a script to set all those dirs and it's contents writable.
I prefer this via a loop so I can echo the result. My shell skills are (still) very minimal, I can't seem to combine them, I can find the dirs from the current working directory, but I can't seem to get it recursive:
for f in ./*/translated/
do
echo $f
done
This only finds ./templates/translated/
, but not ./some/dirs/deeper/translated/
I can use $f
now for a chmod a+rw
, but this will only set the contents writable, how do I also get the dir itself? I need new files to be written in it too.
Summery:
1) How do I make it recursive?
2) How do I set the dir itself to +rw
?