{"id":6238,"date":"2016-02-17T19:32:40","date_gmt":"2016-02-17T18:32:40","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/hayek\/jochen\/wp\/blog-en\/?p=6238"},"modified":"2022-12-23T12:26:41","modified_gmt":"2022-12-23T11:26:41","slug":"xpath-within-shell-scripts","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2016\/02\/17\/xpath-within-shell-scripts\/","title":{"rendered":"doing XPath within shell scripts with a lightweight utility"},"content":{"rendered":"\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/XPath\">https:\/\/en.wikipedia.org\/wiki\/XPath<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/XMLStarlet\">https:\/\/en.wikipedia.org\/wiki\/XMLStarlet<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/xmlstar.sourceforge.net\">http:\/\/xmlstar.sourceforge.net<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Libxml2\">https:\/\/en.wikipedia.org\/wiki\/Libxml2<\/a>&nbsp;&#8212; Perl&#8217;s XML::LibXML (libxml2) is somehow the next alternative to try; it also comes with a command line utility: xmllint; &#8220;xmllint &#8211;shell&#8221; seems worth experimenting with a little<\/li>\n\n\n\n<li><a href=\"https:\/\/sourceforge.net\/projects\/xidel\/\">https:\/\/sourceforge.net\/projects\/xidel\/<\/a>&nbsp;(written in FreePascal\/Lazarus)<\/li>\n\n\n\n<li><a href=\"http:\/\/videlibri.sourceforge.net\/xidel.html#downloads\">http:\/\/videlibri.sourceforge.net\/xidel.html#downloads<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/superuser.com\/questions\/324945\/how-can-i-parse-an-xml-file-from-the-command-line-for-geektool\">http:\/\/superuser.com\/questions\/324945\/how-can-i-parse-an-xml-file-from-the-command-line-for-geektool<\/a>&nbsp;\u2013 more suggestions<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Is XMLStartlet really a reliable and lightweight command line utility to be employed with shell scripts? &#8230; with cygwin shell scripts?!?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">cygwin and fink have each have (ipkg does not) a ready-made XMLStartlet, and for now it seems to do what I need.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">cygwin (?), fink, and ipkg each have a ready-made libxml2 and xmllint.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Is XMLStartlet really a reliable and lightweight command line utility to be employed with shell scripts? &#8230; with cygwin shell scripts?!? cygwin and fink have each have (ipkg does not) a ready-made XMLStartlet, and for now it seems to do what I need. cygwin (?), fink, and ipkg each have a ready-made libxml2 and xmllint.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[82,255,397,851,732],"tags":[],"class_list":["post-6238","post","type-post","status-publish","format-standard","hentry","category-cygwin","category-ipkg","category-opkg","category-xmlstarlet","category-xpath"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-1CC","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=6238"}],"version-history":[{"count":1,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6238\/revisions"}],"predecessor-version":[{"id":12251,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6238\/revisions\/12251"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=6238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=6238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=6238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}