- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Problems with a script that cycles log files
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
Forums
Discussions
Discussions
Discussions
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
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-06-2001 12:14 PM
08-06-2001 12:14 PM
cd $1
for i in `ls -l |grep "^d"| tr -s " " " "|cut -d" " -f9`
do
cd $i
for x in `ls -l -R |grep "^d"| tr -s " " " "|cut -d" " -f9`
do
echo $x
cd $x
for l in `ls`
do
cycle $l 2
done
cd ..
cd $x
echo "In sub dir"
done
cd ..
done
Any help would be greatly appreciated. Please don't limit your responses to fixing my script I'm sure someone out there has a better way of accomplishing this task. Again thankyou for your response.
--Norm Long--
--World Vision--
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2001 12:22 PM
08-06-2001 12:22 PM
Re: Problems with a script that cycles log files
cd $1
find ./ -type d | while read line
do
cd $line
whatever you want
done
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2001 12:30 PM
08-06-2001 12:30 PM
Re: Problems with a script that cycles log files
Howabout something like this:
home=/where/you/want/to/start
find $home -type d | while read line
do
cd $line
#cycle your stuff
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2001 12:54 PM
08-06-2001 12:54 PM
SolutionHope it helps Richard
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2001 09:38 PM
08-07-2001 09:38 PM
Re: Problems with a script that cycles log files
What you do is to go down every directory under your starting point. Then you cycle every file you find.
I would think it is easier to just stay where you are and cycle every file from there. Like
cd $1
find . -type f | while read line
do
cycle $line 2 # or what ever you want
done
Hope this helps
Regards Stefan
BTW: Your profile says: "This member has assigned points to 28 of 78 responses to his/her questions." Please assign points as they help others to find the best solution that was provided.