Operating System - HP-UX
1748105 Members
4787 Online
108758 Solutions
New Discussion юеВ

Re: How to change perms for read only on all directories/sub-directories ?

 
SOLVED
Go to solution
James R. Ferguson
Acclaimed Contributor

Re: How to change perms for read only on all directories/sub-directories ?

Hi (again) Sammy:

> Instead of using one path, i.e, , I want to use various paths in the script

That's easily accomodated.

# cat ./myfix
#!/bin/sh
MYPATHS=$@
for MYPATH in ${MYPATHS}
do
while [ "${#MYPATH}" -gt 1 ]
do
echo chmod g+rw,o+rw ${MYPATH}
MYPATH=$(dirname ${MYPATH})
done
done

...run with one or more paths as the script's arguments, as for example:

# ./myfix /usr/local/patha/pathb /usr/local/pathc/pathd /usr/local/pathe/pathf

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: How to change perms for read only on all directories/sub-directories ?

Shalom,

The scripts are nice but I would just do this:

chmod -R 755 /app/weblogic10

You can even build this into the startup script, if you are willing to modify it.

Regards,

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sammy_2
Super Advisor

Re: How to change perms for read only on all directories/sub-directories ?

Thanks Steve. That will do it for files as well and I only want perms to change for directories.
good judgement comes from experience and experience comes from bad judgement.
James R. Ferguson
Acclaimed Contributor

Re: How to change perms for read only on all directories/sub-directories ?

Hi:

> SEP: The scripts are nice but I would just do this: chmod -R 755 /app/weblogic10

@ SEP: That doesn't meet Sammy's stated problem if you re-read his opening remarks:

> "I just want the directories (not files) and I only want the subdirectories in the path below."

Regards!

...JRF...