Nice, thanks very much!
I’ll try it on my iPhone (after I remove some spurious LF’s added to the email 
when I copied it ) and see if it works. It may take a bit. 

> On Aug 8, 2019, at 11:53 AM, Alex Shroyer <[email protected]> wrote:
> 
> NB. put J on $PATH, then call this script as:
> NB. j ssh-config-table.ijs
> NB. it reads ~/.ssh/config and displays it in table form, even if some of
> the Host entries don't have all the same fields
> NB. or if they are in different order than each other.
> NB. note that it DOES NOT work if you use the ssh_config file rules of
> wildcard or multiple hosts per ruleset, rather each
> NB. host must use its own set of rules.  Maybe someday someday it will
> parse the ssh_config file correctly
> NB. but for now it "works on my machine"
> 
> row =: cut&> ''"_^:('#'={.)each (cutLF;.1~'Host 'E.])fread'~/.ssh/config'
> key =: a:-.~~.,{."1 row
> val =: {:"1 row
> idx =: {."1 key i.row
> echo key,/:~3 :'(y{val) (y{idx) } a:#~1+#key'"0 i.#val
> exit''  NB. comment out this line do debug

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to