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:

https://stackoverflow.com/questions/2153882/how-can-i-shuffle-the-lines-of-a-text-file-on-the-unix-command-line-or-in-a-shel

Jean-Christophe 

> On Jan 14, 2018, at 8:50, Sam Hathaway  wrote:
> 
> 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\ Support/BBEdit
> mkdir -p Text\ Filters
> cd Test\ Filters
> echo -e "#!/bin/sh\necho shuf" > Randomize
> chmod +x Randomize
> 
> You should then see it in the “Apply Text Filter” submenu of the “Text” menu.
> 
> Hope this helps!
> -sam
> 
> On 13 Jan 2018, at 14:46, Vlad Ghitulescu wrote:
> 
> 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
> 
> https://stackoverflow.com/questions/2153882/how-can-i-shuffle-the-lines-of-a-text-file-on-the-unix-command-line-or-in-a-shel
> 
> https://stackoverflow.com/questions/886237/how-can-i-randomize-the-lines-in-a-file-using-standard-tools-on-red-hat-linux
> 
> https://superuser.com/questions/760732/randomly-shuffle-rows-in-a-large-text-file
> 
> but I couldn't find out how to make them work in BBEdit (so I ended using 
> http://www.randomizelist.com until I get a hint from you ;-).
> 
> Could you please help me?
> 
> Thanks!
> 
> Regards,
> Vlad
> 
> P.S. Here's the current list:
> 
> ähnlich
> Antrieb
> auspacken
> blitzschnell
> Brot
> Brücke
> Bruder
> Brunnen
> Bus
> diesem
> Dreieck
> Eichhörnchen
> Ellenbogen
> er hat
> Erfolg
> Erlebnis
> erschrecken
> erzählen
> Fahrzeug
> fallen
> feuerspeiend
> Flicken
> Förster
> Fritz
> Fußball
> Gefahr
> Glück
> groß
> Hals
> hässlich
> hell
> hellblau
> hellbraun
> hellgelb
> hellgrün
> hellorange
> hier
> ich heiße
> ich wünsche mir
> Idee
> ihm
> im Gesicht
> in der letzten Reihe
> Kinderkramm
> Kiste
> knacken
> können
> Leggings
> lieb
> lieber
> Lippen
> Mädchen
> man kann
> Märchen
> Maschine
> Mitte
> Nachmittag
> nichts wie hin
> ohne
> Ohren
> Platz
> Prinz
> Pullover
> Pumpe
> Punkte
> quer
> Rand
> Rasen
> rechts
> schlau
> Schloss
> schützen
> schwarz
> schwimmen
> sehen
> Seite
> sie
> sie sieht aus
> sitzen
> sogar
> Sommersprossen
> Sonne
> Spaß
> spielen
> Staub
> Straße
> Tier
> Tropfen
> tun
> verrückt
> verstecken
> viel
> voll
> von
> vor
> wartet
> Wasser
> Werkstatt
> Werkzeug
> zusammen
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or would like to report a problem, please email
> "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: http://www.twitter.com/bbedit
> --- You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to bbedit+unsubscr...@googlegroups.com.
> To post to this group, send email to bbedit@googlegroups.com.
> Visit this group at https://groups.google.com/group/bbedit.
> 
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a 
> feature request or would like to report a problem, please email
> "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to bbedit+unsubscr...@googlegroups.com.
> To post to this group, send email to bbedit@googlegroups.com.
> Visit this group at https://groups.google.com/group/bbedit.

Jean-Christophe Helary
---
@brandelune http://mac4translators.blogspot.com


-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


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\ Support/BBEdit
mkdir -p Text\ Filters
cd Test\ Filters
echo -e "#!/bin/sh\necho shuf" > Randomize
chmod +x Randomize
```

You should then see it in the “Apply Text Filter” submenu of the 
“Text” menu.


Hope this helps!
-sam

On 13 Jan 2018, at 14:46, Vlad Ghitulescu wrote:


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

https://stackoverflow.com/questions/2153882/how-can-i-shuffle-the-lines-of-a-text-file-on-the-unix-command-line-or-in-a-shel

https://stackoverflow.com/questions/886237/how-can-i-randomize-the-lines-in-a-file-using-standard-tools-on-red-hat-linux

https://superuser.com/questions/760732/randomly-shuffle-rows-in-a-large-text-file

but I couldn't find out how to make them work in BBEdit (so I ended 
using http://www.randomizelist.com until I get a hint from you ;-).


Could you please help me?

Thanks!


Regards,
Vlad


P.S. Here's the current list:

ähnlich
Antrieb
auspacken
blitzschnell
Brot
Brücke
Bruder
Brunnen
Bus
diesem
Dreieck
Eichhörnchen
Ellenbogen
er hat
Erfolg
Erlebnis
erschrecken
erzählen
Fahrzeug
fallen
feuerspeiend
Flicken
Förster
Fritz
Fußball
Gefahr
Glück
groß
Hals
hässlich
hell
hellblau
hellbraun
hellgelb
hellgrün
hellorange
hier
ich heiße
ich wünsche mir
Idee
ihm
im Gesicht
in der letzten Reihe
Kinderkramm
Kiste
knacken
können
Leggings
lieb
lieber
Lippen
Mädchen
man kann
Märchen
Maschine
Mitte
Nachmittag
nichts wie hin
ohne
Ohren
Platz
Prinz
Pullover
Pumpe
Punkte
quer
Rand
Rasen
rechts
schlau
Schloss
schützen
schwarz
schwimmen
sehen
Seite
sie
sie sieht aus
sitzen
sogar
Sommersprossen
Sonne
Spaß
spielen
Staub
Straße
Tier
Tropfen
tun
verrückt
verstecken
viel
voll
von
vor
wartet
Wasser
Werkstatt
Werkzeug
zusammen

--
This is the BBEdit Talk public discussion group. If you have a feature 
request or would like to report a problem, please email

"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- You received this message because you are subscribed to the Google 
Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to bbedit+unsubscr...@googlegroups.com.

To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


--
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email

"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


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

https://stackoverflow.com/questions/2153882/how-can-i-shuffle-the-lines-of-a-text-file-on-the-unix-command-line-or-in-a-shel

https://stackoverflow.com/questions/886237/how-can-i-randomize-the-lines-in-a-file-using-standard-tools-on-red-hat-linux

https://superuser.com/questions/760732/randomly-shuffle-rows-in-a-large-text-file

but I couldn't find out how to make them work in BBEdit (so I ended 
using http://www.randomizelist.com until I get a hint from you ;-).


Could you please help me?

Thanks!


Regards,
Vlad


P.S. Here's the current list:

ähnlich
Antrieb
auspacken
blitzschnell
Brot
Brücke
Bruder
Brunnen
Bus
diesem
Dreieck
Eichhörnchen
Ellenbogen
er hat
Erfolg
Erlebnis
erschrecken
erzählen
Fahrzeug
fallen
feuerspeiend
Flicken
Förster
Fritz
Fußball
Gefahr
Glück
groß
Hals
hässlich
hell
hellblau
hellbraun
hellgelb
hellgrün
hellorange
hier
ich heiße
ich wünsche mir
Idee
ihm
im Gesicht
in der letzten Reihe
Kinderkramm
Kiste
knacken
können
Leggings
lieb
lieber
Lippen
Mädchen
man kann
Märchen
Maschine
Mitte
Nachmittag
nichts wie hin
ohne
Ohren
Platz
Prinz
Pullover
Pumpe
Punkte
quer
Rand
Rasen
rechts
schlau
Schloss
schützen
schwarz
schwimmen
sehen
Seite
sie
sie sieht aus
sitzen
sogar
Sommersprossen
Sonne
Spaß
spielen
Staub
Straße
Tier
Tropfen
tun
verrückt
verstecken
viel
voll
von
vor
wartet
Wasser
Werkstatt
Werkzeug
zusammen

--
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email

"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Text filter question

2018-01-13 Thread Greg Raven
D’oh! I didn’t read down that far. Thanks, Fletcher!

Sent from my iPhone

> On Jan 13, 2018, at 8:13 AM, Fletcher Sandbeck  wrote:
> 
> It looks like JSHint requires a dash to indicate that it should read content 
> from standard input. Many CLI tools read from stdin by default when they 
> don't see a file name specified, but others require - or another parameter to 
> trigger this behavior.
> 
> #!/bin/bash
> jshint -
> 
> http://jshint.com/docs/cli/#specifying-input
> 
> Hope this helps,
> 
> [fletcher]
> 
> 
>> On Jan 13, 2018, at 7:32 AM, Greg Raven  wrote:
>> 
>> I have three text filters in my BBEdit Text Filters folder. Two work, but 
>> one doesn't.
>> 
>> This works:
>> 
>> #!/bin/bash
>> csscomb assets/css
>> 
>> This works:
>> 
>> #!/bin/bash
>> js-beautify
>> 
>> 
>> This doesn't:
>> 
>> #!/bin/bash
>> jshint
>> 
>> 
>> If I open the Terminal.app and navigate to a folder containing a JavaScript 
>> file, I can type in ...
>> 
>> jshint analytics.js
>> 
>> ... (for example) and get a report as expected. I can also invoke the other 
>> two from the command line and have them work as expected.
>> 
>> Any thoughts on what I'm missing?
>> 
>> -- 
>> This is the BBEdit Talk public discussion group. If you have a 
>> feature request or would like to report a problem, please email
>> "supp...@barebones.com" rather than posting to the group.
>> Follow @bbedit on Twitter: 
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "BBEdit Talk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to bbedit+unsubscr...@googlegroups.com.
>> To post to this group, send email to bbedit@googlegroups.com.
>> Visit this group at https://groups.google.com/group/bbedit.
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a 
> feature request or would like to report a problem, please email
> "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: 
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "BBEdit Talk" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/bbedit/Zf4-iSmq38E/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> bbedit+unsubscr...@googlegroups.com.
> To post to this group, send email to bbedit@googlegroups.com.
> Visit this group at https://groups.google.com/group/bbedit.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Text filter question

2018-01-13 Thread Fletcher Sandbeck
It looks like JSHint requires a dash to indicate that it should read content 
from standard input. Many CLI tools read from stdin by default when they don't 
see a file name specified, but others require - or another parameter to trigger 
this behavior.

#!/bin/bash
jshint -

http://jshint.com/docs/cli/#specifying-input 


Hope this helps,

[fletcher]


> On Jan 13, 2018, at 7:32 AM, Greg Raven  wrote:
> 
> I have three text filters in my BBEdit Text Filters folder. Two work, but one 
> doesn't.
> 
> This works:
> 
> #!/bin/bash
> csscomb assets/css
> 
> This works:
> 
> #!/bin/bash
> js-beautify
> 
> 
> This doesn't:
> 
> #!/bin/bash
> jshint
> 
> 
> If I open the Terminal.app and navigate to a folder containing a JavaScript 
> file, I can type in ...
> 
> jshint analytics.js
> 
> ... (for example) and get a report as expected. I can also invoke the other 
> two from the command line and have them work as expected.
> 
> Any thoughts on what I'm missing?
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a 
> feature request or would like to report a problem, please email
> "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter:  >
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to bbedit+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to bbedit@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/bbedit 
> .

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Text filter question

2018-01-13 Thread Greg Raven
I have three text filters in my BBEdit Text Filters folder. Two work, but 
one doesn't.

This works:

#!/bin/bash
csscomb assets/css

This works:

#!/bin/bash
js-beautify


This doesn't:

#!/bin/bash
jshint


If I open the Terminal.app and navigate to a folder containing a JavaScript 
file, I can type in ...

jshint analytics.js

... (for example) and get a report as expected. I can also invoke the other 
two from the command line and have them work as expected.

Any thoughts on what I'm missing?

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.