|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Bash random numbers
Hi
I would like to write a BASH function for .bashrc that would reduce the datafile content for a certain amount in a random way. For example, if the file has a 100000 lines I would like to create a new one keeping only 10% of lines but chosen randomly. Could someone help me on this? how to generate random numbers that could be used in BASH I do not mind combinations with grep, awk ect ... just to be usable from .bashrc thanks oliver |
|
#2
|
|||
|
|||
|
You're in the wrong place. You need to be in either "linux help" or "unix help". You'll get more help over there
![]() *watches mod move it*
__________________
Did this post help? Please Click The Next To My PostNeed help? Did you try Google? Take a look over at my current work in progress http://crispycrisp.org Last edited by xnemesis64 : June 4th, 2007 at 06:04 PM. Reason: You aren't in the "wrong" place, there are just some better ones for your problem =) |
|
#3
|
|||
|
|||
|
To save a further edit, I'll reply again.
Dependent on what OS exactly you are using take a look at /dev/random You should be able to: Code:
cat $var >/dev/urandom And a random number will be in $var for you now. Hope this helps |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Bash random numbers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|