| Summary: | [patch] Addition to random(6) | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | dalroi <dalroi> | ||||
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 3.3-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
dalroi
1999-12-01 13:40:02 UTC
Responsible Changed From-To: freebsd-bugs->billf Billf takes care of stuff in /usr/games Any reason why this patch was never applied? -- (http://tmda.sourceforge.net/) State Changed From-To: open->feedback To submitter: does this patch still apply? Responsible Changed From-To: billf->linimon Assignee did not respond to request for status of this PR, so reassign to the pool. State Changed From-To: feedback->open Submitter's email address bounces. Responsible Changed From-To: linimon->freebsd-bugs random(6) already does this, without the -s. This should be closed. -- Sterling (Chip) Camden | sterling@camdensoftware.com | 2048D/3A978E4F http://camdensoftware.com | http://chipstips.com | http://chipsquips.com could you provide an example how to reproduce the same output (ls /bin | random -s 8) with an unpatched copy of ranom? cheers. alex -- a13x On Mon Aug 9 10, Chip Camden wrote: > Quoth Alexander Best on Tuesday, 10 August 2010: > > could you provide an example how to reproduce the same output (ls /bin | random -s 8) with an unpatched copy of ranom? > > > > cheers. > > alex > > > > -- > > a13x > > > Sure: > > ls /bin | random 8 i don't think this reproduces the exact ouput as `ls /bin | random -s 8`. `random 8` will print each input line with a probability of 1/8th. `random -s 8` on the other hand will print a random line out of every 8 lines of input. this means that for a static number of input lines `random -s 8` will always produce the same number of output lines, wheras the number of lines returned by `random 8` will be different for each run. cheers alex ps: please keep bug-followup@ in the CC field so our conversation gets archived by GNATS. > > -- > Sterling (Chip) Camden | sterling@camdensoftware.com | 2048D/3A978E4F > http://camdensoftware.com | http://chipstips.com | http://chipsquips.com -- a13x Alexander Best <arundel@freebsd.org> wrote: > could you provide an example how to reproduce the same output > (ls /bin | random -s 8) with an unpatched copy of ranom? It's random, so it cannot be reproduced. ;-) But seriously ... If you want random 4 lines out of 32 (or out of any number, for that matter), the following command will do it: $ ls /bin | random -f - | head -4 I agree that this PR can be closed. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "The ITU has offered the IETF formal alignment with its corresponding technology, Penguins, but that won't fly." -- RFC 2549 On Tue Aug 10 10, Oliver Fromme wrote: > Alexander Best <arundel@freebsd.org> wrote: > > could you provide an example how to reproduce the same output > > (ls /bin | random -s 8) with an unpatched copy of ranom? > > It's random, so it cannot be reproduced. ;-) *hehehe* i asume you know what i meant by that request. > > But seriously ... If you want random 4 lines out of 32 > (or out of any number, for that matter), the following > command will do it: > > $ ls /bin | random -f - | head -4 indeed this is an exact replacement for ls /bin | random -s 8. > > I agree that this PR can be closed. thanks a lot for clearing things up. i'll close the PR right away. cheers. alex > > Best regards > Oliver > > -- > Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. > Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: > secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- > chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart > > FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd > > "The ITU has offered the IETF formal alignment with its > corresponding technology, Penguins, but that won't fly." > -- RFC 2549 -- a13x State Changed From-To: open->closed The functionality that is being provided by the patch can be reproduced by ls /bin | random -f -|head -n X (X being the number of random lines that should be generated). Due to this matter and the fact that the patch didn't trigger a lot of interest in more than 10 years I'm closing this PR. Alexander Best wrote: > On Tue Aug 10 10, Oliver Fromme wrote: > > But seriously ... If you want random 4 lines out of 32 > > (or out of any number, for that matter), the following > > command will do it: > > > > $ ls /bin | random -f - | head -4 > > indeed this is an exact replacement for ls /bin | random -s 8. In fact it's a _better_ replacement because the probability is evenly distributed across the whole input. This is not the case for the patch proposed in this PR. > > I agree that this PR can be closed. > > thanks a lot for clearing things up. i'll close the PR right away. Thanks! Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "Whatever happened to the days when hacking started at the cerebral cortex, and not at the keyboard?" -- Sid on userfriendly.org by Illiad, 2007-06-20 Quoth Alexander Best on Tuesday, 10 August 2010: > On Mon Aug 9 10, Chip Camden wrote: > > Quoth Alexander Best on Tuesday, 10 August 2010: > > > could you provide an example how to reproduce the same output (ls /bin | random -s 8) with an unpatched copy of ranom? > > > > > > cheers. > > > alex > > > > > > -- > > > a13x > > > > > > Sure: > > > > ls /bin | random 8 > > i don't think this reproduces the exact ouput as `ls /bin | random -s 8`. > > `random 8` will print each input line with a probability of 1/8th. > > `random -s 8` on the other hand will print a random line out of every 8 lines of input. this means that for a static number of input lines `random -s 8` will always produce the same number of output lines, wheras the number of lines returned by `random 8` will be different for each run. > > cheers > alex > > ps: please keep bug-followup@ in the CC field so our conversation gets archived by GNATS. > > > > > -- > > Sterling (Chip) Camden | sterling@camdensoftware.com | 2048D/3A978E4F > > http://camdensoftware.com | http://chipstips.com | http://chipsquips.com > > Ah, you are correct. I missed that subtle difference. > > -- > a13x -- Sterling (Chip) Camden | sterling@camdensoftware.com | 2048D/3A978E4F http://camdensoftware.com | http://chipstips.com | http://chipsquips.com |