{"id":38,"date":"2005-11-29T14:04:27","date_gmt":"2005-11-29T08:34:27","guid":{"rendered":"http:\/\/ramfree17.org\/capsule\/?p=38"},"modified":"2005-11-29T14:04:27","modified_gmt":"2005-11-29T08:34:27","slug":"one-liner-get-the-last-field","status":"publish","type":"post","link":"https:\/\/ramfree17.net\/capsule\/?p=38","title":{"rendered":"One liner: get the last field"},"content":{"rendered":"<p>Problem: I need to get a list of all java libraries in our repository so I can create a matrix of when they are being used and what is type of license they are using. I tried using a pure Windows approach but it is taking too much time so I used <a href=\"http:\/\/cygwin.com\">Cygwin <\/a>instead. Getting all JAR files is easy with find but I am having difficulty brewing the correct regexp syntax so why prolong the agony and not switch to another tool instead: awk!<\/p>\n<p>    <code>find . -name *.jar | awk -F\/ \u00c2\u00b4{$NF}' | sort | uniq<\/code><\/p>\n<p> where:<\/p>\n<p>    &#8211; find searches recursively from the current directly for all files that end with &#8216;.jar&#8217;<br \/>\n    &#8211; all resulting file paths are piped to awk which, using the forward slash as the column delimiter, prints out the last column<br \/>\n    &#8211; and finally the list of JAR files are sorted alphabetically and duplicates are removed.<\/p>\n<p>This could probably be done in a whole lot of ways (perl, python, sed, etc.) but the beauty of FLOSS is we can use whatever we can to get the same result. \ud83d\ude00<\/p>\n<p>ciao!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem: I need to get a list of all java libraries in our repository so I can create a matrix of when they are being used and what is type of license they are using. I tried using a pure Windows approach but it is taking too much time so I used Cygwin instead. Getting [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,17],"tags":[],"class_list":["post-38","post","type-post","status-publish","format-standard","hentry","category-floss","category-laboratory"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/ramfree17.net\/capsule\/index.php?rest_route=\/wp\/v2\/posts\/38","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ramfree17.net\/capsule\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ramfree17.net\/capsule\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ramfree17.net\/capsule\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ramfree17.net\/capsule\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=38"}],"version-history":[{"count":0,"href":"https:\/\/ramfree17.net\/capsule\/index.php?rest_route=\/wp\/v2\/posts\/38\/revisions"}],"wp:attachment":[{"href":"https:\/\/ramfree17.net\/capsule\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=38"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ramfree17.net\/capsule\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=38"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ramfree17.net\/capsule\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}