Skip to content
Zeev Glozman edited this page Oct 29, 2018 · 9 revisions

Welcome to the ngs wiki!

In this wiki we will assemble simple examples and Q&A, about some of the most valuable NGS features. They are not in any particular order, or logic, but rather some useful things as we develop the language and the feature set.

How to list all top level functions in NGS

ngs -pi 'globals().filterv(Fun)'

How to a array of strings with complex delimiters:

certs = read(fileName) ~~ /-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----/ms

Remove Prefix and Suffix and return a Hash

subject = (`echo ${cert} | openssl x509 -subject -noout` -Sfx("\n") -Pfx("subject= /")).split("/").map(split(X, "=")).Hash() #How to create a Hash "k1", "v1"], ["k2, "v2".Hash();