Re: How to randomize a list?

2018-01-16 Thread Jean-Christophe Helary
> On Jan 16, 2018, at 21:34, Vlad Ghitulescu wrote: > homebrew > > https://apple.stackexchange.com/questions/69223/how-to-replace-mac-os-x-utilities-with-gnu-core-utilities > > Aha! > Never thought I need this until now… Homebrew is interesting for the breadth of choice

Re: How to randomize a list?

2018-01-16 Thread Vlad Ghitulescu
Hi, Jean-Christophe! On 15 Jan 2018, at 13:58, Jean-Christophe Helary wrote: On Jan 15, 2018, at 14:46, Vlad Ghitulescu wrote: What are the GNU Coreutils good for? They are common Linux utilities of which some BSD equivalents are present on macOS.

Re: How to randomize a list?

2018-01-16 Thread Vlad Ghitulescu
On 16 Jan 2018, at 13:57, Jean-Christophe Helary wrote: drwxr-xr-x@ 5 Vlad staff 170 14 Jan 21:17 . drwxr-xr-x@ 17 Vlad staff 578 15 Jan 06:44 .. -rwxr-xr-x@ 1 Vlad staff 111 1 Nov 2016 Delete_Viewed_Video_in_Lynda_TOC.pl -rwxr--r--@ 1 Vlad staff 69 15 Jan 06:32 Randomize.sh -rwxr-xr-x@ 1

Re: How to randomize a list?

2018-01-16 Thread Jean-Christophe Helary
> On Jan 16, 2018, at 21:36, Vlad Ghitulescu wrote: > >>> drwxr-xr-x@ 5 Vlad staff 170 14 Jan 21:17 . >>> drwxr-xr-x@ 17 Vlad staff 578 15 Jan 06:44 .. >>> -rwxr-xr-x@ 1 Vlad staff 111 1 Nov 2016 Delete_Viewed_Video_in_Lynda_TOC.pl >>> -rwxr--r--@ 1 Vlad staff 69 15 Jan

Re: How to randomize a list?

2018-01-16 Thread Vlad Ghitulescu
On 15 Jan 2018, at 15:33, Sam Hathaway wrote: That worked even whitout making the file Randomize.sh executable with chmod +x Randomize! Take a look: Vlads27iMac2012:Text Filters Vlad$ ls -al total 48 drwxr-xr-x@ 5 Vlad staff 170 14 Jan 21:17 . drwxr-xr-x@ 17 Vlad staff 578 15 Jan 06:44

Re: How to randomize a list?

2018-01-15 Thread Christopher Stone
On 01/14/2018, at 15:31, Sam Hathaway > wrote: > Try replacing the contents of your “Randomize” text filter with: > #!/usr/bin/env perl > use List::Util 'shuffle'; > print shuffle(); Hey Vlad, I'm with Sam, although I'd write it

Re: How to randomize a list?

2018-01-15 Thread Sam Hathaway
On 15 Jan 2018, at 0:46, Vlad Ghitulescu wrote: (sorry for the following dumb questions… I've used Linux last time in 1993! :-) What are the GNU Coreutils good for? Should I install them too? (I've read about the difference in the performance of the various randomizer solutions in the

Re: How to randomize a list?

2018-01-15 Thread Jean-Christophe Helary
> On Jan 15, 2018, at 14:46, Vlad Ghitulescu wrote: > > What are the GNU Coreutils good for? They are common Linux utilities of which some BSD equivalents are present on macOS. https://www.gnu.org/software/coreutils/manual/coreutils.html > Should I install them too?

Re: How to randomize a list?

2018-01-14 Thread Vlad Ghitulescu
Hi, Sam! Thanks for staying with me! :-) On 14 Jan 2018, at 22:31, Sam Hathaway wrote: So sorry for leading you astray with `shuf`. I’ve had GNU Coreutils installed for so long that I’ve forgotten what’s in stock macOS. (sorry for the following dumb questions… I've used Linux last time in

Re: How to randomize a list?

2018-01-14 Thread Sam Hathaway
So sorry for leading you astray with `shuf`. I’ve had GNU Coreutils installed for so long that I’ve forgotten what’s in stock macOS. It sounds like your `sort` is too old to have `-R`. Jean-Christophe’s Perl solution would probably be easiest at this point. Try replacing the contents of

Re: How to randomize a list?

2018-01-14 Thread Vlad Ghitulescu
Hi, Jean-Christophe! sort -R brings this error message: sort: invalid option -- R Try `sort --help' for more information. and sort --help brings this: -- Vlads27iMac2012:~ Vlad$ sort --help Usage: sort [OPTION]... [FILE]... Write sorted concatenation of all FILE(s) to standard output.

Re: How to randomize a list?

2018-01-14 Thread Vlad Ghitulescu
Hi, Sam! Thanks for the explanations & reminder (I think Chris was so nice to show me this once - because I still have two TextFilters - but I didn't use it since then and I've forgot :-((() It seems that shuf is not there, because everything I've got is this error message: /Application

Re: How to randomize a list?

2018-01-13 Thread Jean-Christophe Helary
shuf requires coreutils which is not in macOS by default. You can install it with homebrew. sort -R seems to be available in recent versions of macOS (the man page indicates a 2015 date). There is also a solution with Perl as given here:

Re: How to randomize a list?

2018-01-13 Thread Sam Hathaway
Make a text filter called Randomize with the contents: ``` #!/bin/sh exec shuf ``` Text filters go in ~/Library/Application Support/BBEdit/Text Filters. I think they probably have to be executable. Running these command in Terminal should do the trick: ``` cd ~/Library/Application\

How to randomize a list?

2018-01-13 Thread Vlad Ghitulescu
Hello! I have a list of difficult words / phrases for my son (see below) that I want to randomize in order to keep the boy awake :-) I've found similar (old!) questions: http://bbedit-talk.barebones.narkive.com/jXrdz0T6/randomize-lines