On 1/12/21 at 10:22 AM, [email protected] (Christopher Finazzo) wrote:

I am redoing a filter which sorts a list of items. Although which zsh tells me the location of the executable is at /usr/local/bin/zsh, BBEdit says there is nothing on STDIN when I run this against a document.

#!/usr/local/bin/zsh

sort "$1" | uniq | sort -nr | bbedit

Should this be in /usr/bin? Somehow this hasn't come up with the other filters I've used - mostly in other languages so I haven't had to fix them in this way before.


The default (OS-provided) zsh is '/bin/zsh' so perhaps you've installed another version via Homebrew (or similar).

Also, a couple points about your filter:

Since BBEdit sends the contents of the frontmost document (or selection) to the filter on STDIN and 'sort' will accept data on STDIN, the "$1" is superfluous.

Likewise, since BBEdit expects the filter to provide output on STDOUT, there's no need to pipe to the 'bbedit' tool, so please try this:

========
#!/bin/zsh
sort | uniq | sort -nr
========


Regards

 Patrick Woolsey
==
Bare Bones Software, Inc.             <https://www.barebones.com/>

--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "[email protected]" rather than posting here. 
Follow @bbedit on Twitter: <https://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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/r480Ps-10146i-07BA2BF0C16E4585BD5B4A9C0480B682%40Cylinder.local.

Reply via email to