- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to traverse sub. dirs?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 09:36 AM
тАО08-15-2002 09:36 AM
Re: How to traverse sub. dirs?
The following doesn't work with net perms.
cat file | while read a
do
net perms /u5/data/$a/*
done
Where file = ls -d /u5/data/* > file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 09:37 AM
тАО08-15-2002 09:37 AM
Re: How to traverse sub. dirs?
You have files in subdirs that you need to run the 'net perm' command against.
Which files in which subdirs need this?
Are all of the sub-dirs under /u5/data? So you have megax, tomx, etc.? Or are the subdirs under /u5/data/megax?
I'm really confused about exactly what you are trying to accomplish.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 09:41 AM
тАО08-15-2002 09:41 AM
Re: How to traverse sub. dirs?
You have a list of subdirs under /u5/data that you want to process and this list is in the file /u5/data/subdirs.
# cat /u5/data/subdirs
tomx
megax
You then write a script that reads from that file and does what you want:
#!/usr/bin/sh
for i in `cat /u5/data/subdirs`
do
find /u5/data/$i -exec net perm {} \;
done
That will run the find command for all dirs in /u5/data/subdirs execute whatever it is you need in each of the subdirs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 09:41 AM
тАО08-15-2002 09:41 AM
Re: How to traverse sub. dirs?
cd /u5/data
# assuming there are only directories in /u5/data
for dir in *
do
find $dir -xdev -exec chmod 777 {} \;
done
That way you'll traverse all sub-dirs of /u5/data one at a time.
If you have files in /u5/data you could change the "for" statement to:
for dir in `ll | awk '/^d/ {print $NF}'`
Is this closer to what you need?
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 09:41 AM
тАО08-15-2002 09:41 AM
Re: How to traverse sub. dirs?
There are 49 sub dirs. under /u5/data.
How to traverse one of 49 sub dirs under /u5/data without crossing over into another sub dir?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 09:44 AM
тАО08-15-2002 09:44 AM
Re: How to traverse sub. dirs?
if you have /u5/data/1, /u5/data/2, ... /u5/data/400,
and you cd to /u5/data, then a simple find 2 will give you only the files/dirs under /u5/data/2/*.
If you just want files listed, not directories, use the type f option.
ie: find 2 -type f (pwd=/u5/data)
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 09:46 AM
тАО08-15-2002 09:46 AM
Re: How to traverse sub. dirs?
Like /u5/data/megax/someotherdir
and you DON'T want to go into the someotherdir directory under megax?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 09:50 AM
тАО08-15-2002 09:50 AM
Re: How to traverse sub. dirs?
you can write a script for doing this. first get a list of all sub-dirs, then:
for s in `cat sub_dir_list`
do
find /u5/data/$i -depth -exec net perms {} \;
done
This will do each dir. seperately and if you want you can add more lines for more functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 09:59 AM
тАО08-15-2002 09:59 AM
Re: How to traverse sub. dirs?
find /u5/data/$s ..
actually, are you trying to give different settings for different sub-dirs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 10:06 AM
тАО08-15-2002 10:06 AM
Re: How to traverse sub. dirs?
cd /u5/data
# assuming there are only directories in /u5/data
for dir in *
do
find $dir -exec net perms {} \;
done
But I'm going to have to substitute an inner loop for the find command above in order to break apart the data and write output to 49 separate files for all 49 dirs.
I think that will do it.
Thanks