- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Another Scripting Question
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
02-13-2004 12:11 AM
02-13-2004 12:11 AM
But is there a simpler way of getting this random file.
Thanks again,
Pete
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2004 12:15 AM
02-13-2004 12:15 AM
Re: Another Scripting Question
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2004 12:19 AM
02-13-2004 12:19 AM
Re: Another Scripting Question
bdf |Randomly pick a mounted filesystem
ls | Get a file, if is a directory drill down until I do get a file.
The whole script is about 30 lines, but I'm sure there is an easier way of doing it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2004 12:26 AM
02-13-2004 12:26 AM
Re: Another Scripting Question
generate a random number N
do a find -type f
and use awk to print line N.
JP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2004 12:32 AM
02-13-2004 12:32 AM
Re: Another Scripting Question
I'd though of that, the problem with this is what level do I set the random number too. There are also certain files that I don't want to get back.
Thanks anyway,
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2004 12:43 AM
02-13-2004 12:43 AM
Re: Another Scripting Question
Or get a random number and do:
find
bdf -i will help you find limits for the random number in the latter case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2004 12:44 AM
02-13-2004 12:44 AM
Re: Another Scripting Question
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2004 12:48 AM
02-13-2004 12:48 AM
Re: Another Scripting Question
you may generate more than 1 randomnumber, or retry if the number is too high, although this makes it less random.
(You have posed a question on random numbers. Usually a random generator generates a number between 0 and 1 (no access to manpages iright now). You multiply this by the amount of files you have.)
Why do you want certain files excluded?
You are not restoring the files to the original location I assume?
Greetings,
JP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2004 01:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2004 01:26 AM
02-13-2004 01:26 AM